救急:有关 Log4J 系统的文件属性配置的问题?

tyb98032 2003-08-23 05:26:24
相信做网络服务器端应用的网友都用过它来 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?

谢谢先!
...全文
34 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qljsd 2003-10-14
  • 打赏
  • 举报
回复
在classpath下
sunruiandxwh 2003-10-14
  • 打赏
  • 举报
回复
在其他路径下找找!
jkit 2003-08-24
  • 打赏
  • 举报
回复
log4j.appender.R.File 我都是使用绝对路径的,没出过问题。
tyb98032 2003-08-24
  • 打赏
  • 举报
回复
up

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧