log4j 的生产设置文件?
这是我当前的log4j设置文件。这些设置是否适合生产使用,或者我应该删除/调整或更改某些内容?我问,因为我所有的线程都由于log4j阻塞而被挂起。我检查了我的打开的文件描述符,我只使用113。
# ***** Set root logger level to WARN and its two appenders to stdout and R.
log4j.rootLogger=warn, stdout, R
# ***** stdout is set to be a ConsoleAppender.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
# ***** stdout uses PatternLayout.
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# ***** Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
# ***** R is set to be a RollingFileAppender.
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=logs/myapp.log
# ***** Max file size is set to 100KB
log4j.appender.R.MaxFileSize=102400KB
# ***** Keep one backup file
log4j.appender.R.MaxBackupIndex=5
# ***** R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %d %c - %m%n
#set httpclient debug levels
log4j.logger.org.apache.component=ERROR,stdout
log4j.logger.httpclient.wire=ERROR,stdout
log4j.logger.org.apache.commons.httpclient=ERROR,stdout
log4j.logger.org.apache.http.client.protocol=ERROR,stdout
更新*** 从我的所有线程添加线程转储示例 (100)
"pool-1-thread-5" - Thread t@25
java.lang.Thread.State: BLOCKED on org.apache.log4j.spi.RootLogger@1d45a585 owned by: pool-1-thread-35
at org.apache.log4j.Category.callAppenders(Category.java:201)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.error(Category.java:302)