Avalon Log4J Logging Plugin

Overview

The Log4J plugin for Avalon Logging allows for the usage of Apache Log4J log system to be driving your Avalon application. It is a very thin wrapper to Log4J, introducing a single extra method call (non reflected) for the log output methods.

Instead of mixing in the Log4J configuration into the rest of Avalon configuration files, they remain external and are instead referenced. Both XML and Properties files are supported, and by giving an optional update element, the configureAndWatch() method will be used.

NOTE! "Base Directory" (property "avalon.logging.basedir") is NOT SUPPORTED inside any Log4J configuration files, and all relative filenames inside the Log4J configuration will relative to user.dir (current directory).

XML Specification

Nested Element Description
src The filename or URL of the Log4J configuration file. This file can either be an XML or a Properties configuration file, but MUST end with ".xml" if it is the former. A relative filename will resolve relative to Base Directory (property "avalon.logging.basedir").
update The Update Interval. For files, unlike URLs, it is possible for Log4J to check for the file being modified externally, and if so reload the configuration. If this element is specified and has a positive value, this FileWatch feature of Log4J will be used. The time is specified in milliseconds.

Example

    <logging>
      <src>conf/log4j.xml</src>
      <!-- Check for Update once every minute. -->
      <update>60000</src>
    </logging>