View RSS Feed

Log4j

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.
  • log4j.configuration=log4j.properties


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

  • log4j.rootCategory=priority [, appender]*


Default (root) logger priority is set.

  • log4j.logger.logger.name=priority


Set the priority for the named logger and all loggers hierarchically lower than, or below, the named logger.logger.name 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 del.icio.us Submit "Configuring Log4J" to StumbleUpon Submit "Configuring Log4J" to Google

Categories
Commons Lang

Comments