救急:有关 Log4J 系统的文件属性配置的问题?
相信做网络服务器端应用的网友都用过它来 log.那么请告诉小弟:
#===========================================================================
# The root category uses two appenders called A1 and R. Since no priority is
# specified, the root category assumes the default priority for root
# which is DEBUG in log4j. The root category is the only category that
# has a default priority. All other categories need not be assigned a
# priority in which case they inherit their priority from the
# hierarchy.
#===========================================================================
log4j.rootCategory=, A1, R
#=======================================================================
# A1 is set to be a LF5Appender which outputs to a swing
# logging console.
#=======================================================================
log4j.appender.A1=org.apache.log4j.lf5.LF5Appender
#=======================================================================
# R is the RollingFileAppender that outputs to a rolling log
# file called searchProxy.log.
#=======================================================================
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=searchProxy.log
# Define a pattern layout for the file.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[slf5s.start]%d{DATE}[slf5s.DATE]%n%p[slf5s.PRIORITY]%n%x[slf5s.NDC]%n%t[slf5s.THREAD]%n%c[slf5s.CATEGORY]%n%l[slf5s.LOCATION]%n%m[slf5s.MESSAGE]%n%n
# Set the max size of the file and the number of backup files
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
我想知道为什么我设置的两个 Appernder 中只有A1=org.apache.log4j.lf5.LF5Appender 可以使用,他是带 UI 的,比较方便查看。而我的第二个 R=org.apache.log4j.RollingFileAppender 文件 logger 确没有在我的网站虚拟目录下出现。 Why?
谢谢先!