To configure Log4j for
your client, you should create a Log4j configuration file. The configuration
file can be either an XML file or a properties file. You can specify
the location of your configuration file by using the
-Dlog4j.configuration=path-to-file
on your JVM command
line.
For example, the following
properties file specifies a root logger for all logging activity,
a logger for all classes within the
com.sas
hierarchy, and a logger for
com.sas.services.connection
:
# http://logging.apache.org/log4j/docs/manual.html
# Available log priority levels are: TRACE, DEBUG, INFO, WARN, ERROR, FATAL
log4j.rootCategory=ERROR, A1
log4j.logger.com.sas=WARN, SASConsoleAppender
log4j.additivity.com.sas=false
log4j.logger.com.sas.services.connection=INFO, SASConsoleAppender
log4j.additivity.com.sas.services.connection=false
#
# A1 is a ConsoleAppender
# note: when the SAS foundation Logging Service reconfigures the root logger
# this appender will be closed.
#
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p [%t] - %m%n
#
# SASConsoleAppender is a ConsoleAppender
#
log4j.appender.SASConsoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.SASConsoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.SASConsoleAppender.layout.ConversionPattern=%-5p [%t] - %m%n