标签:div out pre 1.2 jar包 logger OLE img std
jar包:
org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar org\slf4j\slf4j-log4j12\1.7.25\slf4j-log4j12-1.7.25.jar log4j\log4j\1.2.17\log4j-1.2.17.jar
配置:
/test
/test/src/main/java
/test/src/main/java/test
/test/src/main/java/log4j.properties
/test/src/main/resources
/test/src/main/resources/git_add
/test/src/main/resources/log4j.properties
log4j.rootLogger=info, stdout #log4j.rootLogger=info, logfile ### console \u65E5\u5FD7 ### log4j.appender.stdout = org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target = System.out log4j.appender.stdout.layout = org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern = %d %p [%c %L] - %m%n log4j.appender.logfile=org.apache.log4j.FileAppender log4j.appender.logfile.File=tmp/aidfs.log log4j.appender.logfile.layout=org.apache.log4j.PatternLayout log4j.appender.logfile.layout.ConversionPattern= %d %p [%c %L] - %m%n
格式化输出:
import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LineSeparator { private static Logger logger = LoggerFactory.getLogger(LineSeparator.class); public static void main(String[] args) { logger.info("{}, {}, {}", true, 1, "lin"); } }
标签:div out pre 1.2 jar包 logger OLE img std
原文地址:https://www.cnblogs.com/wenlin-gk/p/9791237.html