vue+springboot项目日志文件部署
作者:互联网
<?xml version="1.0" encoding="utf-8" ?> <configuration> <!--指定生产环境和测试环境的日子地址--> <springProfile name="dev"> <property name="LOG_HOME" value="D:\Desktop\starfield\traffic\logs"></property> </springProfile> <springProfile name="prd"> <property name="LOG_HOME" value="\Desktop\starfield\traffic\logs"></property> </springProfile> <!--控制台--> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示五个字符宽度 %lwg:日志消息--> <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %lwg%n </pattern> </layout> </appender> <!--配置我们的日志一天为单位进行生成 滚动式--> <appender name="rolling" class="ch.qos.logback.core.rolling.RollingFileAppender"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicy"> <FileNamePattern> ${LOG_HOME}/traffic-system.%d{yyyy-MM-dd}.log </FileNamePattern> <!--记录最多不超过30--> <MaxHistory>30</MaxHistory> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示五个字符宽度 %lwg:日志消息--> <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %lwg%n </pattern> </layout> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <!--最大文件大小--> <MaxFileSize>10MB</MaxFileSize> </triggeringPolicy> </appender> <!--上面的日志配置生效--> <root level="info"> <appender-ref ref="stdout"></appender-ref> <appender-ref ref="rollingFile"></appender-ref> </root> </configuration>
标签:%-,vue,springboot,MM,dd,yyyy,HH,日志,lwg% 来源: https://www.cnblogs.com/linwenguan/p/16387537.html