Commit 5b72237e authored by Quxl's avatar Quxl

修改日志配置

parent 5cd40145
spring.datasource.url=jdbc:mysql://10.10.0.111:3306/film_critic_2018?useSSL=false&useUnicode=true&characterEncoding=utf8 spring.datasource.url=jdbc:mysql://10.10.0.111:3306/film_new?useSSL=false&useUnicode=true&characterEncoding=utf8
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=egolm#2018 spring.datasource.password=egolm#2018
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<property name="LOG_BASE_PATH" value="/data/logs/film" />
<include resource="org/springframework/boot/logging/logback/base.xml" /> <include resource="org/springframework/boot/logging/logback/base.xml" />
<logger name="springfox" level="ERROR" />
<logger name="com.egolm" level="DEBUG" />
<appender name="siftingAppender" class="ch.qos.logback.classic.sift.SiftingAppender"> <appender name="siftingAppender" class="ch.qos.logback.classic.sift.SiftingAppender">
<discriminator> <discriminator>
<key>CTX_PATH</key> <key>context</key>
<DefaultValue>logback</DefaultValue> <DefaultValue>logback</DefaultValue>
</discriminator> </discriminator>
<sift> <sift>
<appender name="rollingFileAppender" <appender name="rollingFileAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${LOG_BASE_PATH}/${CTX_PATH}-%d{yyyy-MM-dd}.log</FileNamePattern> <FileNamePattern>/data/logs/film/${CTX_PATH}-%d{yyyy-MM-dd}.log</FileNamePattern>
<MaxHistory>30</MaxHistory> <MaxHistory>30</MaxHistory>
</rollingPolicy> </rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
...@@ -31,4 +26,22 @@ ...@@ -31,4 +26,22 @@
<appender-ref ref="siftingAppender" /> <appender-ref ref="siftingAppender" />
</root> </root>
<springProfile name="dev">
<root level="DEBUG">
<appender-ref ref="siftingAppender" />
</root>
</springProfile>
<springProfile name="pro">
<root level="INFO">
<appender-ref ref="siftingAppender" />
</root>
</springProfile>
<logger name="springfox" level="ERROR" />
<logger name="javax" level="ERROR" />
<logger name="java" level="ERROR" />
<logger name="net" level="ERROR" />
<logger name="org" level="INFO" />
</configuration> </configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment