1 pom.xml
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
2、log4j.properties
# Define the root logger with appender file
log = /opt/platform/apache-tomcat-7.0.55/logs
log4j.rootLogger = DEBUG,FILE,Console
# Define the file appender
log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE.File=${log}/log.out
# Set the immediate flush to true (default)
log4j.appender.FILE.ImmediateFlush=true
# Set the threshold to debug mode
log4j.appender.FILE.Threshold=debug
# Set the append to false, should not overwrite
log4j.appender.FILE.Append=true
# Set the DatePattern
log4j.appender.FILE.DatePattern='.' yyyy-MM-dd-a
# Define the layout for file appender
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%d [%p] %l %m%n
# Define the file appender
log4j.appender.Console=org.apache.log4j.ConsoleAppender
# Define the layout for file appender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.conversionPattern=%d [%p] %l %m%n
分享到:
相关推荐
本工程用于演示如何使用slf4j+log4j完美构建日志 本工程编码方式:UTF-8 本工程开发工具:Eclipse 参考博客:http://blog.csdn.net/gaohuanjie/article/details/53405020
本资源主要介绍log4j2涉及到的一些知识内容。很多内容时对网络资源的整理,整体来说相对较全了,基本覆盖了常见场景
针对 tomcat9 slf4j+log4j2 不写日志的问题进行修复
使用slf4j + log4j需要的jar包: slf4j-api-1.x.x.jar slf4j-log4j12-1.x.x.jar log4j-1.2.x.jar
slf4j+log4j需要的jar和配置文件,下载之后可以直接使用
web项目使用slf4j+log4j2来输出日志。说明了需要引入的jar包及配置
针对 tomcat8 slf4j+log4j2 不写日志的问题进行修复
log4j-1.2.17; slf4j-api-1.7.12; slf4j-log4j12-1.7.12; slf4j-api-1.7.25; slf4j-log4j12-1.7.25;
学习hibernate技术用到的一些jar包收集集合
赠送jar包:slf4j-log4j12-1.7.25.jar; 赠送原API文档:slf4j-log4j12-1.7.25-javadoc.jar; 赠送源代码:slf4j-log4j12-1.7.25-sources.jar; 赠送Maven依赖信息文件:slf4j-log4j12-1.7.25.pom; 包含翻译后的API...
log4j+slf4j实现 log4j测试代码,log4j+slf4j实现 log4j测试代码,
赠送jar包:slf4j-log4j12-1.6.1.jar; 赠送原API文档:slf4j-log4j12-1.6.1-javadoc.jar; 赠送源代码:slf4j-log4j12-1.6.1-sources.jar; 赠送Maven依赖信息文件:slf4j-log4j12-1.6.1.pom; 包含翻译后的API文档...
ehcache-2.10.2.jar ,slf4j-api-1.7.7.jarm,slf4j-jdk14-1.7.7.jar,slf4j-log4j12-1.7.7.jar,log4j-1.2.17.jar
赠送jar包:slf4j-log4j12-1.7.21.jar; 赠送原API文档:slf4j-log4j12-1.7.21-javadoc.jar; 赠送源代码:slf4j-log4j12-1.7.21-sources.jar; 赠送Maven依赖信息文件:slf4j-log4j12-1.7.21.pom; 包含翻译后的API...
log4j-slf4j+logback1.3.0 共六个jar包
ZK 前端框架 继承 SpringMVC + log4j2 + slf4j + durid 数据库加密
slf4j-log4j12-1.0.jarslf4j-log4j12-1.0.jarslf4j-log4j12-1.0.jarslf4j-log4j12-1.0.jarslf4j-log4j12-1.0.jarslf4j-log4j12-1.0.jarslf4j-log4j12-1.0.jarslf4j-log4j12-1.0.jarslf4j-log4j12-1.0.jarslf4j-log4...