You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by ed...@yahoo.com on 2005/04/02 06:01:52 UTC

stdout & log4j in tomcat 5.5

sorry about the eariler tomcat only post. my bad. 2 questions:
 
1) does the config file below look ok to you all in a general way, no
obvious errors, etc?
 
2) im trying to get my log4j output for my web app (win2k server &
tomcat 5.5) to only go to my log files.  its a standard setup: using
commons logging & log4j 1.2., the log4j.props is in my web-inf/classes.

 
problem is that it looks like some things (system.outprintln(),
org.apache.struts, etc ) are still also going to the stdout log files
(e.g stdout_20050401.log).  i see what i expect in my log files, but i *
didnt * want to see it in the stdout log.  is that a normal limitation
of log4j 1.2.9/tomcat 5.5 or did i miss something here.
 
# log4j.properties
#---------------------------------------------------------------
log4j.rootCategory=DEBUG, roll-error
 
#----------- my web
log4j.category.com.company-name=DEBUG, roll-debug
log4j.additivity.com.company-name=FALSE
#---------------------------------------------------------------
# Console Appender
#---------------------------------------------------------------
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.Threshold=INFO
log4j.appender.console.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.console.layout.ConversionPattern=%d{MM/dd/yy
HH:mm:ss,SSS} %-5p %l - (%F:%L) %m%n
 
#---------------------------------------------------------------
# Rolling File Appender -- for errors
#---------------------------------------------------------------
log4j.appender.roll-error=org.apache.log4j.RollingFileAppender
log4j.appender.roll-error.File=${catalina.base}/logs/app-name-staging-er
ror-t.log
log4j.appender.roll-error.Threshold=WARN
log4j.appender.roll-error.MaxFileSize=1500KB
log4j.appender.roll-error.MaxBackupIndex=10
log4j.appender.roll-error.layout=org.apache.log4j.PatternLayout
log4j.appender.roll-error.layout.ConversionPattern=%d{MM/dd/yy
HH:mm:ss,SSS} %-5p %l - (%F:%L) %m%n
 
#---------------------------------------------------------------
# Rolling File Appender - debugging for general
#---------------------------------------------------------------
log4j.appender.roll-debug=org.apache.log4j.RollingFileAppender
log4j.appender.roll-debug.File=${catalina.base}/logs/app-name-staging-de
bug-t.log
log4j.appender.roll-debug.Threshold=DEBUG
log4j.appender.roll-debug.MaxFileSize=1000KB
log4j.appender.roll-debug.MaxBackupIndex=0
log4j.appender.roll-debug.layout=org.apache.log4j.PatternLayout
log4j.appender.roll-debug.layout.ConversionPattern=[%x] - %d{MM/dd/yy
HH:mm:ss,SSS} %-5p %l - (%F:%L) %m%n
 

thanks