org.codehaus.plexus.logging.log4j
Class Log4JLoggerManager

java.lang.Object
  extended byorg.codehaus.plexus.logging.AbstractLoggerManager
      extended byorg.codehaus.plexus.logging.BaseLoggerManager
          extended byorg.codehaus.plexus.logging.log4j.AbstractLog4JLoggerManager
              extended byorg.codehaus.plexus.logging.log4j.Log4JLoggerManager
All Implemented Interfaces:
org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.logging.LoggerManager, org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable

public class Log4JLoggerManager
extends AbstractLog4JLoggerManager
implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable

Logger Manager for Log4j logging system which is configurable by plexus services. A simple configuration:

 
  <configuration>
    <threshold>DEBUG</threshold>
    <default-appender>file</default-appender>
    <appenders>
      <appender>
        <id>file</id>
        <threshold>INFO</threshold>
        <type>org.apache.log4j.FileAppender</type>
        <conversion-pattern>%-4r [%t] %-5p %c %x - %m%n</conversion-pattern>
 
        <properties>
          <property>
            <key>file</key>
            <value>${plexus.home}/logs/plexus.log</value>
          </property>
          <property>
            <key>append</key>
            <value>true</value>
          </property>
        </properties>
      </appender>
 
      <appender>
        <id>console</id>
        <type>org.apache.log4j.ConsoleAppender</type>
        <conversion-pattern>%-4r [%t] %-5p %c %x - %m%n</conversion-pattern>
      </appender>
 
      <appender>
        <id>rolling</id>
        <threshold>DEBUG</threshold>
        <type>org.apache.log4j.RollingFileAppender</type>
        <conversion-pattern>%-4r [%t] %-5p %c %x - %m%n</conversion-pattern>
 
        <properties>
          <property>
            <key>file</key>
            <value>${plexus.home}/logs/plexus-rolling.log</value>
          </property>
          <property>
            <key>append</key>
            <value>true</value>
          </property>
          <property>
            <key>maxBackupIndex</key>
            <value>10</value>
          </property>
          <property>
            <key>maxFileSize</key>
            <value>20</value>
          </property>
        </properties>
      </appender>
    </appenders>
  </configuration>
  
 

Version:
$Id: Log4JLoggerManager.java 2926 2005-12-06 08:46:48Z evenisse $
Author:
Michal Maczka, Trygve Laugstøl

Field Summary
 
Fields inherited from interface org.codehaus.plexus.logging.LoggerManager
ROLE
 
Constructor Summary
Log4JLoggerManager()
           
 
Method Summary
 java.util.Properties getLog4JProperties()
           
 void initialize()
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.codehaus.plexus.logging.log4j.AbstractLog4JLoggerManager
createLogger, getThresholdAsString
 
Methods inherited from class org.codehaus.plexus.logging.BaseLoggerManager
getActiveLoggerCount, getLoggerForComponent, getThreshold, getThreshold, parseThreshold, returnComponentLogger, setThreshold, setThreshold
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLoggerManager
getLoggerForComponent, getThreshold, returnComponentLogger, setThreshold, toMapKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4JLoggerManager

public Log4JLoggerManager()
Method Detail

initialize

public void initialize()
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

start

public void start()
           throws org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException
Specified by:
start in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException

stop

public void stop()
          throws org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException
Specified by:
stop in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException

getLog4JProperties

public java.util.Properties getLog4JProperties()


Copyright © {inceptionYear}-2007 null. All Rights Reserved.