logback.xml 向右看齐 2023-06-18 15:58 2阅读 0赞 <property name="log.pattern" value="[%date][%level][%thread][%logger{0}][%method,%line] -%msg%n" /> <property name="log.name" value="station-service-statistics" /> <springProperty scope="context" name="log.path" source="log.path" /> <springProperty scope="context" name="log.level" source="log.level" /> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>${log.pattern}</pattern> </encoder> </appender> <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${log.path}/${log.name}.log</file> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>${log.pattern}</Pattern> </layout> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <fileNamePattern>${log.path}/${log.name}-%d{yyyy-MM-dd-HH}-%i.log</fileNamePattern> <maxHistory>30</maxHistory> <maxFileSize>500MB</maxFileSize> </rollingPolicy> </appender> <root level="${log.level}"> <appender-ref ref="file" /> <appender-ref ref="stdout" /> </root>
还没有评论,来说两句吧...