I am very new to log4j and have only been able to get simple logging
applications up and running.
 
We have multiple web applications running and all of the applications
have all of their logging done by a single class with different
functions (i.e. writeDebug calls log.debug(), writeError calls
log.error(), etc).
 
I would like to have all of the errors go to one file, while all of the
info go to another and all of the debug go to another (I realize that
debug will get info and error logs).  With my properties file as it
stands, all of the logs go to the console and the only file that gets
created is the info log (NOT the error log).
 
Anyway, my log4j.properties file looks like:       
 
log4j.logger.com.webapp.app.SAM=DEBUG, debugLog, sqlLog, errorLog
log4j.additivity.com.webapp.app.SAM=false
 
log4j.appender.debugLog.Threshold=FATAL
log4j.appender.debugLog=org.apache.log4j.ConsoleAppender
log4j.appender.debugLog.layout=org.apache.log4j.PatternLayout
log4j.appender.debugLog.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
 
#Setting this to FATAL will stop the sqlLog from being printed to the
file
log4j.appender.sqlLog.Threshold=INFO
log4j.appender.sqlLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.sqlLog.DatePattern='.'yyyy-MM-dd
log4j.appender.sqlLog.File=WebBaseSQLLog.log
log4j.appender.sqlLog.layout=org.apache.log4j.PatternLayout
log4j.appender.sqlLog.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
 
#Setting this to FATAL will stop the errorLog from being printed to the
file
log4j.appender.errorLog.Threshold=ERROR
log4j.appender.errorLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.errorLog.DatePattern='.'yyyy-MM-dd
log4j.appender.errorLog.File=WebBaseSQLLog.log
log4j.appender.errorLog.layout=org.apache.log4j.PatternLayout
log4j.appender.errorLog.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

 
 
Does anyone see what I'm doing wrong here?!?

Reply via email to