Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j problem writing to a log file.

 
John Smith
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my log4j.properties. I am using JBoss. I see log messages in my JBoss console, but for some reason, it is not writing to a log file.

I am not that familiar with the log4j. It would be grateful if someone can fix it.



log4j.rootLogger=INFO, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
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

log4j.appender.INFO=org.apache.log4j.ConsoleAppender

log4j.category.org=INFO


log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=D:\\example.log

log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=9
log4j.appender.R.append=true

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
 
Paul Clapham
Sheriff
Posts: 21129
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Possibly JBoss is not even using that properties file. Do the log entries you see match the conversion pattern you used? Try changing the conversion pattern to something different and see if the format of the log entries changes. Those tests should tell you whether JBoss is using your properties file or some other properties file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic