标签:span 生成 编写 生产 pre 日志 nes enc apache
https://blog.csdn.net/a1017680279/article/details/79212848
<!-- SLF4J --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.7</version> </dependency>
log4j.rootLogger=DEBUG,console,file ### console ### log4j.appender.console = org.apache.log4j.ConsoleAppender log4j.appender.console.Target = System.out log4j.appender.console.layout = org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern = [%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n ### log file ### log4j.appender.file = org.apache.log4j.DailyRollingFileAppender log4j.appender.file.File =./logs/info.log log4j.appender.file.Append = true log4j.appender.file.Threshold = warn log4j.appender.file.layout = org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern = [%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n # 输出liveness日志 # log4j.logger.liveness = INFO, liveness # 是否在父log中输出日志 # log4j.additivity.liveness = false # 每天生产日志文件 # log4j.appender.liveness = org.apache.log4j.DailyRollingFileAppender # 生成日志到单独的文件 # log4j.appender.liveness.File =../logs/liveness.log # 追加日志 # log4j.appender.liveness.Append = true # 日志级别 # log4j.appender.liveness.Threshold = INFO # log4j.appender.liveness.layout = org.apache.log4j.PatternLayout # 日志格式 # log4j.appender.liveness.layout.ConversionPattern = [%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n
https://files.cnblogs.com/files/jtfr/TestLog4jDemo.zip
标签:span 生成 编写 生产 pre 日志 nes enc apache
原文地址:https://www.cnblogs.com/jtfr/p/11124814.html