首页 > 代码库 > 项目中用到的logback列子
项目中用到的logback列子
转自: 项目中用到的logback列子
某个银行项目中实际引用的Llogback实例,禁提供大家参考!!!!
<!-- if debug set to true, context info always print otherwise the contex info will print when error occour --> <configuration scan="true" scanPeriod="60 seconds" debug="false"> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{40} - %msg%n</pattern> </layout> </appender> <!-- 所有日志文件--> <appender name="AllLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>log/abcchina/all/%d{yyyy-MM-dd}.log</fileNamePattern> <maxHistory>30</maxHistory> </rollingPolicy> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{40} - %msg%n</pattern> </encoder> </appender> <appender name="TaskLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>log/abcchina/task/%d{yyyy-MM-dd}.log</fileNamePattern> <maxHistory>30</maxHistory> </rollingPolicy> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{40} - %msg%n</pattern> </encoder> </appender> <appender name="SendLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>log/abcchina/send/%d{yyyy-MM-dd}.log</fileNamePattern> <maxHistory>30</maxHistory> </rollingPolicy> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{40} - %msg%n</pattern> </encoder> </appender> <!-- 为莫个包下的所有类指定Appender 这里也可以指定类名称例如:com.aa.bb.ClassName--> <logger name="com.aa.bb" > <appender-ref ref="TaskLog" /> </logger> <logger name="com.aa.cc" > <appender-ref ref="SendLog" /> </logger> <root level="INFO"> <appender-ref ref="AllLog" /> </root> </configuration>
项目中用到的logback列子
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。