aspose file tools*
The moose likes Other Open Source Projects and the fly likes log4j problem writing to a log file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j problem writing to a log file. " Watch "log4j problem writing to a log file. " New topic
Author

log4j problem writing to a log file.

John Smith
Greenhorn

Joined: Oct 07, 2003
Posts: 15
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
Bartender

Joined: Oct 14, 2005
Posts: 18903
    
    8

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.
 
 
subject: log4j problem writing to a log file.