最近一段时间发现项目用了JBoss之后日志变得非常大。都是好几百兆了。于是在网上查找一些文档自己整理了一下关于JBoss日志的输出设置,我们先看下面一段代码
#运行和错误日志写到文件
log4j.appender.RunningLog =org.apache.log4j.sift.MDCSiftingAppender
log4j.appender.RunningLog.key=bundle.name
log4j.appender.RunningLog.default=jboss
log4j.appender.RunningLog.appender=org.apache.log4j.DailyRollingFileAppender
#Rollover at the top of each day
log4j.appender.RunningLog.appender.DatePattern ='.'yyyy-MM-dd
log4j.appender.RunningLog.appender.file=${karaf.data}/log/$\\{bundle.name\\}/RunningLog.log
log4j.appender.RunningLog.appender.append=true
log4j.appender.RunningLog.appender.layout=org.apache.log4j.PatternLayout
log4j.appender.RunningLog.appender.layout.ConversionPattern=