org.kuali.rice.core.config.logging
Class Log4jLifeCycle

java.lang.Object
  extended by org.kuali.rice.core.lifecycle.BaseLifecycle
      extended by org.kuali.rice.core.config.logging.Log4jLifeCycle
All Implemented Interfaces:
Lifecycle

public class Log4jLifeCycle
extends BaseLifecycle

Lifecycle implementation that initializes and shuts down Log4J logging


Nested Class Summary
private static class Log4jLifeCycle.WorkflowLog4j_1_2_13_Configurer
          Subclasses the Spring Log4jConfigurer to expose a static method which accepts an initial set of properties (to use for variable substitution)
(package private) static class Log4jLifeCycle.WorkflowLog4j_1_2_13_PropertyConfigurator
          Subclasses the Log4j 1.2.13 PropertyConfigurator to add a static method which accepts an initial set of properties (to use for variable substitution)
 
Field Summary
private static String AUTOMATIC_LOGGING_CONFIG_URL
          Location of default/automatic Log4J configuration properties, in Spring ResourceUtils resource/url syntax
private static int DEFAULT_RELOAD_INTERVAL
          Default settings reload interval to use in the case that the settings are reloadable (i.e.
private  org.apache.log4j.Logger log
          Non-static and non-final so that it can be reset after configuration is read
private static String LOG4J_FILE_NOT_FOUND
           
private static int MINUTE
          Convenience constant representing a minute in milliseconds
 
Constructor Summary
Log4jLifeCycle()
           
 
Method Summary
private  boolean checkPropertiesFileExists(String log4jSettingsPath)
          Checks if the passed in file exists.
private static String getLog4jVersion()
          Uses reflection to attempt to obtain the ImplementationVersion of the org.apache.log4j package from the jar manifest.
 void start()
           
 void stop()
           
 
Methods inherited from class org.kuali.rice.core.lifecycle.BaseLifecycle
isStarted, setStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_FILE_NOT_FOUND

private static final String LOG4J_FILE_NOT_FOUND
See Also:
Constant Field Values

MINUTE

private static final int MINUTE
Convenience constant representing a minute in milliseconds

See Also:
Constant Field Values

AUTOMATIC_LOGGING_CONFIG_URL

private static final String AUTOMATIC_LOGGING_CONFIG_URL
Location of default/automatic Log4J configuration properties, in Spring ResourceUtils resource/url syntax

See Also:
Constant Field Values

DEFAULT_RELOAD_INTERVAL

private static final int DEFAULT_RELOAD_INTERVAL
Default settings reload interval to use in the case that the settings are reloadable (i.e. they originate from a file)

See Also:
Constant Field Values

log

private org.apache.log4j.Logger log
Non-static and non-final so that it can be reset after configuration is read

Constructor Detail

Log4jLifeCycle

public Log4jLifeCycle()
Method Detail

start

public void start()
           throws Exception
Specified by:
start in interface Lifecycle
Overrides:
start in class BaseLifecycle
Throws:
Exception

checkPropertiesFileExists

private boolean checkPropertiesFileExists(String log4jSettingsPath)
Checks if the passed in file exists.

Parameters:
log4jSettingsPath - the file
Returns:
true if exists

getLog4jVersion

private static String getLog4jVersion()
Uses reflection to attempt to obtain the ImplementationVersion of the org.apache.log4j package from the jar manifest.

Returns:
the value returned from Package.getPackage("org.apache.log4j").getImplementationVersion() or null if package is not found

stop

public void stop()
          throws Exception
Specified by:
stop in interface Lifecycle
Overrides:
stop in class BaseLifecycle
Throws:
Exception


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.