Logging configuration in JRDS

Global log configuration

Jrds use log4j for logging. But this library can need quite a lot of thinking before a useful setup is done. So jrds wrap it for a faster setup and provide fast configuration elements.

The log setting properties are :

  • nologging: disable totally the logs configuration.
  • logfile: where the logs are to be written.
  • loglevel: the default log level, taken from {trace, debug , info, warn, error, fatal}.
  • log.{trace, debug , info, warn, error, fatal}: specify the log level for a comma separated list of class.
  • log4jxmlfile: the path to a log4J XML file that will override the jrds log configuration.
  • log4jpropfile: the path to a log4J properties file that will override the jrds log configuration.

The level are the same as in log4j, and are, with increased verbosity :

fatal, error, warn, info, debug, trace.

Trace level should be avoided except in some rare conditions and even debug level can be quite verbose.

By default, logs are send in the file indicated by the logfile property which is then rotated on a weekly basis.

If jrds is used as a library and a logger called “jrds” already exist, it will do not configure log4j at all.

The log4xmlfile and log4jpropfile can be used by peoples fluent on log4j and wanting fine tune control on it.

The default log4j configuration is similar to this log4j.properties file:

log4j.appender.jrdsAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.jrdsAppender.DatePattern='.'yyyy-ww
log4j.appender.jrdsAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.jrdsAppender.layout.ConversionPattern=[%d] %5p %c : %m%n
log4j.logger.jrds=INFO,jrdsAppender
log4j.additivity.jrds=false
log4j.logger.org.mortbay.log=INFO, jrdsAppender
log4j.additivity.org.mortbay.log=false
log4j.logger.org.apache=INFO, jrdsAppender
log4j.additivity.org.apache=false
log4j.logger.org.snmp4j=INFO, jrdsAppender
log4j.additivity.org.snmp4je=false

Debuging a probe or a connection

Log level for a specific class or logger is set with the property :

log.LEVEL=CLASSLIST

The argument CLASSLIST is a comma separated list of Java classes or logger names.

For ease of developpement there is some magic in probes and starters. As there is a lot of heritage in them, it might needs a lot of differents classes set to debug to follow a probe. So special loggers are build called jrds.Probe.ProbeName and jrds.Starter.StarterName that follows the operation of a probe and a starter between the differents level of heritage.

 
jrdslogging.txt · Last modified: 2014/04/24 15:34 by root     Back to top