Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
polysoft-nafmii
/
polysoft-parent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e6482ab9
authored
Apr 28, 2021
by
ypenglv
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改配置
1 parent
c0347a63
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
13 deletions
nafmii-admin/src/main/resources/logback-spring.xml
nafmii-app/src/main/resources/application-dev.yml
nafmii-app/src/main/resources/application-prod.yml
nafmii-app/src/main/resources/application-test.yml
nafmii-app/src/main/resources/logback-spring.xml → nafmii-common/src/main/resources/logback-spring.xml
nafmii-admin/src/main/resources/logback-spring.xml
deleted
100644 → 0
View file @
c0347a6
This diff is collapsed.
Click to expand it.
nafmii-app/src/main/resources/application-dev.yml
View file @
e6482ab
...
...
@@ -47,3 +47,4 @@ spring:
timeout
:
1000ms
nafmii
:
log-path
:
D:/NAFMII
dao-uri
:
org.nafmii.app
\ No newline at end of file
nafmii-app/src/main/resources/application-prod.yml
View file @
e6482ab
...
...
@@ -47,3 +47,4 @@ spring:
timeout
:
1000ms
nafmii
:
log-path
:
D:/NAFMII
dao-uri
:
org.nafmii.app
\ No newline at end of file
nafmii-app/src/main/resources/application-test.yml
View file @
e6482ab
...
...
@@ -47,3 +47,4 @@ spring:
timeout
:
1000ms
nafmii
:
log-path
:
E:/NAFMII
dao-uri
:
org.nafmii.app
\ No newline at end of file
nafmii-
app
/src/main/resources/logback-spring.xml
→
nafmii-
common
/src/main/resources/logback-spring.xml
View file @
e6482ab
...
...
@@ -12,6 +12,7 @@
<!--<include resource="org/springframework/boot/logging/logback/base.xml" /> -->
<springProperty
scope=
"context"
name=
"springAppName"
source=
"spring.application.name"
/>
<springProperty
scope=
"context"
name=
"daoUri"
source=
"nafmii.dao-uri"
/>
<springProperty
scope=
"context"
name=
"logPath"
source=
"nafmii.log-path"
/>
<property
name=
"log.path"
value=
"${logPath}/${springAppName}"
/>
<!-- 彩色日志 -->
...
...
@@ -27,7 +28,7 @@
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
info
</level>
<level>
DEBUG
</level>
</filter>
<encoder>
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
...
...
@@ -133,10 +134,10 @@
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
<maxFileSize>
50
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>
15
</maxHistory>
<maxHistory>
30
</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
...
...
@@ -163,32 +164,24 @@
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
-->
<!--
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--开发环境:打印控制台-->
<springProfile
name=
"dev"
>
<logger
name=
"
org.nafmii.app"
level=
"debug"
/>
<logger
name=
"
${daoUri}"
level=
"DEBUG"
/>
<root
level=
"info"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"DEBUG_FILE"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"WARN_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
</root>
</springProfile>
<!--生产环境:输出到文件-->
<springProfile
name=
"!dev"
>
<logger
name=
"
org.nafmii.app
"
level=
"info"
/>
<logger
name=
"
${daoUri}
"
level=
"info"
/>
<root
level=
"info"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"INFO_FILE"
/>
...
...
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