参考URL:
https://blog.csdn.net/zhengtaoit66/article/details/79551945
https://www.cnblogs.com/lujiango/p/8573411.html
http://maven.outofmemory.cn/org.slf4j/slf4j-log4j12/
https://blog.csdn.net/hzh_csdn/article/details/53282533
■インストール方法
方法一(複数):
1 <dependency> 2 <groupId>org.slf4j</groupId> 3 <artifactId>slf4j-log4j12</artifactId> 4 <version>1.7.25</version> 5 </dependency>
必要なLibファイル:
log4j-1.2.17.jar + slf4j-log4j12-1.7.25.jar + slf4j-api-1.7.25.jar
方法二(単一):
1 <dependency> 2 <groupId>log4j</groupId> 3 <artifactId>log4j</artifactId> 4 <version>1.2.17</version> 5 </dependency>
必要なLibファイル:
log4j-1.2.17.jar
■プロパティファイルの設定
#--------------------------------------------------------------------------------------- # Logger #--------------------------------------------------------------------------------------- # Root log4j.rootLogger=DEBUG,STDOUT, ROOT #--------------------------------------------------------------------------------------- # Appender #--------------------------------------------------------------------------------------- # for Root log4j.appender.ROOT=org.apache.log4j.ConsoleAppender log4j.appender.ROOT.Target=System.out log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout log4j.appender.ROOT.layout.ConversionPattern=%-5p - %m%n # for SQL log4j.appender.STDOUT=org.apache.log4j.RollingFileAppender log4j.appender.STDOUT.File=C:/Users/LNSYLT/Tools/pleiades2018/log/ssm.log log4j.appender.STDOUT.Append=true log4j.appender.STDOUT.MaxFileSize=1MB log4j.appender.STDOUT.MaxBackupIndex=20 log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.ConversionPattern=%d %-5.12p [%C{2}][%F][%M(%L)] - %m%n