org.apache.geronimo.system.logging.log4j
Class Log4jService

java.lang.Object
  extended byorg.apache.geronimo.system.logging.log4j.Log4jService
All Implemented Interfaces:
org.apache.geronimo.gbean.GBeanLifecycle

public class Log4jService
extends Object
implements org.apache.geronimo.gbean.GBeanLifecycle

A Log4j logging service.

Version:
$Revision: 1.8 $ $Date: 2004/07/25 08:15:35 $

Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
Log4jService(String rootLoggerLevel, String configurationFile, int refreshPeroid, ServerInfo serverInfo)
          Construct a Log4jService.
 
Method Summary
 void doFail()
           
 void doStart()
           
 void doStop()
           
 String getConfigurationFile()
          Get the logging configuration URL.
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 String getLoggerLevel(String logger)
          Gets the level of the logger of the give name.
 int getRefreshPeriod()
          Get the refresh period.
 String getRootLoggerLevel()
          Gets the level of the root logger.
 void reconfigure()
          Force the logging system to reconfigure.
 void setConfigurationFile(String configurationFile)
          Set the logging configuration URL.
 void setLoggerLevel(String logger, String level)
          Sets the level for a logger of the give name.
 void setRefreshPeriod(int period)
          Set the refresh period.
 void setRootLoggerLevel(String level)
          Sets the level of the root logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

Log4jService

public Log4jService(String rootLoggerLevel,
                    String configurationFile,
                    int refreshPeroid,
                    ServerInfo serverInfo)
Construct a Log4jService.

Parameters:
configurationFile - The log4j configuration file.
refreshPeroid - The refresh refreshPeroid (in seconds).
Method Detail

getRootLoggerLevel

public String getRootLoggerLevel()
Gets the level of the root logger.


setRootLoggerLevel

public void setRootLoggerLevel(String level)
Sets the level of the root logger.

Parameters:
level - The level to change the logger to.

getLoggerLevel

public String getLoggerLevel(String logger)
Gets the level of the logger of the give name.

Parameters:
logger - The logger to inspect.

setLoggerLevel

public void setLoggerLevel(String logger,
                           String level)
Sets the level for a logger of the give name.

Parameters:
logger - The logger to change level
level - The level to change the logger to.

getRefreshPeriod

public int getRefreshPeriod()
Get the refresh period.

Returns:
the refresh period (in seconds)

setRefreshPeriod

public void setRefreshPeriod(int period)
Set the refresh period.

Parameters:
period - the refresh period (in seconds)
Throws:
IllegalArgumentException - if refresh period is <= 0

getConfigurationFile

public String getConfigurationFile()
Get the logging configuration URL.

Returns:
the logging configuration URL

setConfigurationFile

public void setConfigurationFile(String configurationFile)
Set the logging configuration URL.

Parameters:
configurationFile - the logging configuration file

reconfigure

public void reconfigure()
Force the logging system to reconfigure.


doStart

public void doStart()
Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle

doStop

public void doStop()
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.