Question : log4j not writing to file

Below is my attempt at using both the console and a file to write log statements to.  The c:\\temp\\logs\\file.log get created but then when I write to the log using the below code nothing gets written.  The console shows the INFO, WARN and ERROR log statements but skips the DEBUG one.

 Log log = LogFactory.getLog(this.getClass());
 log.debug("debug");
 log.info("info");
 log.warn("warn");
 log.error("error");

# The logging properties used for IDE based testing, we want to see
# debug output on the console (use out in that case).
# log4j.rootLogger=INFO, out
log4j.rootCategory=INFO, out, R

log4j.logger.org.springframework=WARN
log4j.logger.spot.web=DEBUG

# CONSOLE appender not used by default
log4j.appender.out=org.apache.log4j.ConsoleAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

# Second appender writes to a file
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=c:\\temp\\logs\\spot-gen2-webservices.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# Control the maximum log file size
log4j.appender.R.MaxFileSize=10MB
# Archive log files (one backup file here)
log4j.appender.R.MaxBackupIndex=100

Answer : log4j not writing to file

It sounds as if we have solved your original question, but now you have problems with your glassfish configuration.

I think it would be better to assign points on this question and start a new one on glassfish and log4j, since glassfish is its own special area.

Have you followed the steps recommended here?:
http://wiki.glassfish.java.net/Wiki.jsp?page=FaqCongifureLog4J
With this additional note from the author of the above page:
http://weblogs.java.net/blog/schaefa/archive/2007/08/to_the_hell_wit_1.html

This article has some good points about glassfish and log4j as well:
http://www.randombugs.com/java/glassfish/changing-logging-system-glassfish-21.html
Random Solutions  
 
programming4us programming4us