赞
踩
- <configuration>
- <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" />
- <property name="FILE_PATH" value="D:/logs/course03/demo.%d{yyyy-MM-dd}.%i.log" />
-
- <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
- <pattern>${LOG_PATTERN}</pattern>
- </encoder>
- </appender>
-
- <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- 按照上面配置的FILE_PATH路径来保存日志 -->
- <fileNamePattern>${FILE_PATH}</fileNamePattern>
- <!-- 日志保存15天 -->
- <maxHistory>15</maxHistory>
- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
- <!-- 单个日志文件的最大,超过则新建日志文件存储 -->
- <maxFileSize>10MB</maxFileSize>
- </timeBasedFileNamingAndTriggeringPolicy>
- </rollingPolicy>
-
- <encoder>
- <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
- <pattern>${LOG_PATTERN}</pattern>
- </encoder>
- </appender>
-
-
-
- <logger name="com.yfy.springboot" level="INFO" />
- <root level="INFO">
- <appender-ref ref="CONSOLE" />
- <appender-ref ref="FILE" />
- </root>
-
-
- </configuration>
- logging:
- config: classpath:logback.xml
- level:
- com:
- yfy:
- springboot:
- dao : debug
level后面是dao层的目录,配置控制台输出sql
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。