Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
framework-tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 210511bb
authored
Jul 12, 2024
by
henry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志配置文件
1 parent
a97f7340
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
3 deletions
framework-analysis/src/main/resources/logback-spring.xml
framework-asset/src/main/resources/logback-spring.xml
framework-gateway/src/main/resources/logback-spring.xml
framework-system-manage/src/main/resources/logback-spring.xml
framework-analysis/src/main/resources/logback-spring.xml
View file @
210511b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<!--定义日志文件的存储地址 -->
<!--定义日志文件的存储地址 -->
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<property
name=
"LOG_NAME"
value=
"a
rch-overall
"
/>
<property
name=
"LOG_NAME"
value=
"a
nalysis
"
/>
<!--从配置中心加载数据-->
<!--从配置中心加载数据-->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
...
...
framework-asset/src/main/resources/logback-spring.xml
View file @
210511b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<!--定义日志文件的存储地址 -->
<!--定义日志文件的存储地址 -->
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<property
name=
"LOG_NAME"
value=
"a
rch-overall
"
/>
<property
name=
"LOG_NAME"
value=
"a
sset
"
/>
<!--从配置中心加载数据-->
<!--从配置中心加载数据-->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
...
...
framework-gateway/src/main/resources/logback-spring.xml
0 → 100644
View file @
210511b
<?xml version="1.0" encoding="UTF-8"?>
<configuration
debug=
"false"
>
<!--定义日志文件的存储地址 -->
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<property
name=
"LOG_NAME"
value=
"gateway"
/>
<!--从配置中心加载数据-->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<springProperty
scope=
"context"
name=
"logstashDestination"
source=
"logstash.destination"
/>
<!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<withJansi>
true
</withJansi>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}:%L) - %msg%n
</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件INFO -->
<appender
name=
"INFO_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${LOG_HOME}/${LOG_NAME}_info.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--日志文件输出的文件名 -->
<FileNamePattern>
${LOG_HOME}/${LOG_NAME}_info.%d{yyyy-MM-dd}.%i.log
</FileNamePattern>
<maxHistory>
30
</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!-- 按照每天生成日志文件ERROR -->
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${LOG_HOME}/${LOG_NAME}_error.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${LOG_HOME}/${LOG_NAME}_error.%d{yyyy-MM-dd}.log
</FileNamePattern>
<MaxHistory>
30
</MaxHistory>
</rollingPolicy>
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50}:%L - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<!-- 只打印错误日志 -->
<level>
ERROR
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!--nacos 心跳 INFO 屏蔽-->
<logger
name=
"com.alibaba.nacos"
level=
"OFF"
>
<appender-ref
ref=
"ERROR_FILE"
/>
</logger>
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"TRACE"
/>
<logger
name=
"java.sql.Connection"
level=
"DEBUG"
/>
<logger
name=
"java.sql.Statement"
level=
"DEBUG"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"DEBUG"
/>
<logger
name=
"com.xxl.job.core"
level=
"DEBUG"
/>
<logger
name=
"org.apache.http.impl.conn"
level=
"INFO"
/>
<logger
name=
"springfox.documentation"
level=
"INFO"
/>
<logger
name=
"org.springframework"
level=
"INFO"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"INFO"
/>
<!-- 本地环境 -->
<springProfile
name=
"local"
>
<root
level=
"DEBUG"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
</root>
</springProfile>
<!-- 其它环境 -->
<springProfile
name=
"dev,test,stage,prod,sit,uat,default"
>
<root
level=
"DEBUG"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
</root>
</springProfile>
</configuration>
\ No newline at end of file
framework-system-manage/src/main/resources/logback-spring.xml
View file @
210511b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<!--定义日志文件的存储地址 -->
<!--定义日志文件的存储地址 -->
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<property
name=
"LOG_NAME"
value=
"
arch-overall
"
/>
<property
name=
"LOG_NAME"
value=
"
system-manage
"
/>
<!--从配置中心加载数据-->
<!--从配置中心加载数据-->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment