View RSS Feed


Configuring Log4J

Rate this Entry
by , 02-24-2012 at 08:17 PM (752 Views)
Log4J is considered to be the most frequently used library, for logging. Log4J present in your application has integration details which will be discussed in this section. A property file and system properties are used to configure Log4J.

This system property is used for specification of the Log4J configuration file naming. Default configuration file would be, in case it is not specified.

  • log4j.rootCategory=priority [, appender]*

Default (root) logger priority is set.


Set the priority for the named logger and all loggers hierarchically lower than, or below, the named corresponds to the parameter of LogFactory.getLog, used to create the logger instance. Priorities are: DEBUG, INFO, WARN,ERROR, or FATAL.

  • log4j.appender.appender.Threshold=priority

Log4J appenders corresponds with files, console, sockets and many other output devices. In case when threshold of the appender is equal to or less than message priority, it means that message has been written by appender. Different detail levels would be allowed by it to be shown at various log destinations.

Submit "Configuring Log4J" to Facebook Submit "Configuring Log4J" to Digg Submit "Configuring Log4J" to Submit "Configuring Log4J" to StumbleUpon Submit "Configuring Log4J" to Google

Commons Lang