-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm sure this is simple simple I'm missing. I don't want any errors dumping to my catalina.out file under Tomcat. Any errors thrown, runtime or otherwise, I want dumping to my rolling file appender. I removed my console out appender and set my root logger to my file appender but I can't seem to get errors thrown to it.
Obviously ZK is trapping errors since for example if I do a divide by zero error I'll see a zk popup window with the error displayed. I want the actual error though to show up in my file appender.
Here is what I've tried so far:
log4j.rootLogger=debug, app-appender log4j.logger.org.springframework=info, app-appender log4j.logger.com.ncs=debug, app-appender log4j.logger.org.ibatis=info, app-appender log4j.logger.org.zkoss=debug, app-appender log4j.appender.app-appender=org.apache.log4j.RollingFileAppender log4j.appender.app-appender.threshold=ALL log4j.appender.app-appender.File=${catalina.home}/logs/productReference.log log4j.appender.app-appender.MaxFileSize=2000KB log4j.appender.app-appender.MaxBackupIndex=5 log4j.appender.app-appender.Append=false log4j.appender.app-appender.layout=org.apache.log4j.PatternLayout log4j.appender.app-appender.layout.ConversionPattern= %d{MM/dd/yy hh:mm:ss a } %-5p %C %M - %m%n
Not sure if all this is needed as well but I also added:
web.xml
<context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/classes/log4j.properties</param-value> </context-param>
zk.xml
<log> <log-base>org.zkoss</log-base> </log> <library-property> <name>org.zkoss.util.logging.config.file</name> <value>/log4j.properties</value> </library-property>
I haven't dug into the source code but is it possible that after ZK traps a runtime exception that it's not attempting to log it with java.util.logging? I understand how if it were simply rethrowing the error I'd have issues getting it logged to my appender, but it's obviously trapping it first since it's showing a zk popup, so I'd assume it attempts to log the exception as well?
As I know, ZK uses the java standard logger (i.e java.util.loggin). You can't give ZK a log4j configuration.
Check this: http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/Supporting_Utilities/Logger#Disable_All_Logs
Asked: 2012-11-12 16:28:11 +0800
Seen: 52 times
Last updated: Nov 13 '12