- Configure MAVEN Dependencies First
<!--Http://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 -<Dependency> <groupId>Org.slf4j</groupId> <Artifactid>Slf4j-log4j12</Artifactid> <version>1.7.21</version></Dependency>
View Code
- Code Catalog add log4j.properties configuration file
#config root Loggerlog4j.rootlogger = info,system.outlog4j.appender.system.out= org.apache.log4j.consoleappenderlog4j.appender.system.out.layout= Org.apache.log4j.patternlayoutlog4j.appender.system.out.layout.conversionpattern=luceneserver Logger-->%5p{% F:%l}-%m%n#config this project.file loggerlog4j.logger.thisproject.file=info, thisproject.file.outlog4j.appender.thisproject.file.out= org.apache.log4j.dailyrollingfileappenderlog4j.appender.thisproject.file.out.file= Logcontentfile.loglog4j.appender.thisproject.file.out.layout=org.apache.log4j.patternlayout
View Code
Private Static Final Logger Logger = Loggerfactory.getlogger (seachtest. Class);
slf4j+log4j configuration (Maven)