Java Mailer Logging

SpamZilla?'s JavaMail component uses Apache log4j for it's logging. This was both because log4j is a very efficient and robust logging utility, and because Apache Axis requires it.

For detailed information about controlling log4j, please refer to the log4j documentation. However, below is a high level overview of how to control log4j as Axis and JavaMail use it.

log4j extracts a file called log4j.properties out of the first valid classpath location. A simple way to manage this is to put "." at the begining of your classpath, and put a log4j.properties file in the location where you start JavaMail.

Trace

Trace is the highest debug level in log4j, in this level, all available output will be emitted. To make debugging of JavaMail as painless as possible, it emits a large number of trace messages. These should aid in diagnosis of any possible issues with the mailing component. However, if you are logging to a file, you will want to turn this level down, the level of trace is suggested for standard output only.

log4j.rootCategory=TRACE, CONSOLE

Web service debugging

Is controlled through the Axis log handler configuration.

log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE
log4j.logger.org.apache.axis=INFO, CONSOLE 
log4j.logger.org.apache.axis.encoding=FATAL, CONSOLE
log4j.logger.org.apache.axis.utils=FATAL, CONSOLE
log4j.logger.org.apache.axis.message=FATAL, CONSOLE

CONSOLE, LOGFILE

Either if these are interchangable. The log file is defined with the property log4j.appender.LOGFILE.File which has a default of "spamzilla.log".