
主要操作logback.xml和application.yml
注释掉logback.xml中的
<appender-ref ref="console"/>
注释掉application.yml中的
logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
application.yml
mybatis:
configuration:
mapUnderscoreToCamelCase: true
logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
typeAliasesPackage: com.jsptpd.gayg.modules
mapperLocations: classpath:com/jsptpd/gayg/**/*.xml
spring:
resource:
static-locations: file:/public/
http:
multipart:
max-file-size: 20Mb
max-request-size: 80Mb
profiles:
# active: dev
active: prod
session:
cookieName: Session100136
headerName: Session100136
logback.xml
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>
</layout>
</appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>log/log.txt</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>log/log-%d{yyyy-MM-dd}.%i.txt</fileNamePattern>
<maxFileSize>5MB</maxFileSize>
<maxHistory>60</maxHistory>
<totalSizeCap>20GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>[%-5level] %d{HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</root>
</configuration>
网友评论