|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmonks.batch.framework.LoggingManager
Logging Manager provides the logging services to the framework. It defines the default logging mechanism at the framework level which works for all the jobs and provide the facility to use their own logging mechanism.
The default logging mechanism defined at the framework will
work like this. It reads the directory to create the log files from
the framework logging configuration <logging-config> and creates a directory
with the "job-name" and create the log files for each run. So, the format
will be
<directory-defined-in-config>/job-name/jobname_with_timestamp.log
If job developer would like to override this logging mechanism, they can define their logging configuration in the element <job-logging-config> in batch job configuration file or defining entries in job_logging_config table.
Field Summary | |
static java.lang.String |
DEFAULT_MESSAGE_PATTERN
Standard pattern expression used for all the log files. |
static java.lang.String |
FRAMEWORK_LOGGING_FILE
Framework configuration file which is batch_framework.log. |
Method Summary | |
static boolean |
changeLogLevel(java.lang.String loggerName,
org.apache.log4j.Level newLogLevel)
Changes the log level for the requested logger name with the given log level. |
static org.apache.log4j.Level |
getLogLevel(java.lang.String loggerName)
Gets the log level of the given logger name. |
static void |
initializeFrameworkLogging(FrameworkConfig.FrameworkLoggingConfig frameworkLoggingConfig,
Main loggingInitalizer)
Initializes the logging of the framework in the directory defined in framework configuration. |
static void |
initializeJobLogging(java.lang.String jobName,
FrameworkConfig.FrameworkLoggingConfig frameworkLoggingConfig,
JobLoggingConfig jobLoggingConfig,
Main loggingInitalizer)
This method accepts all the information available from framwork logging configuration and job logging configuration and loads the required loggers appropriately. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String FRAMEWORK_LOGGING_FILE
public static final java.lang.String DEFAULT_MESSAGE_PATTERN
Method Detail |
public static void initializeJobLogging(java.lang.String jobName, FrameworkConfig.FrameworkLoggingConfig frameworkLoggingConfig, JobLoggingConfig jobLoggingConfig, Main loggingInitalizer)
This method accepts all the information available from framwork logging configuration and job logging configuration and loads the required loggers appropriately. This does the follwing steps.
jobName
- Name of the job.frameworkLoggingConfig
- Logging configuration defined at the framework.loggingInitalizer
- Main class instance which is authorized to initailze the job logging.
java.lang.SecurityException
- If any class other than Main(framework) tried to initialize the job logging.
ConfigurationException
- If logging file cannot be created at the configured directory.
public static void initializeFrameworkLogging(FrameworkConfig.FrameworkLoggingConfig frameworkLoggingConfig, Main loggingInitalizer)
frameworkLoggingConfig
- Framework logging configuration object.loggingInitalizer
- Main class instance which is authorized to initailze the logging.
java.lang.SecurityException
- If any class other than Main(framework) tried to initialize the framework logging.
ConfigurationException
- If logging directory cannot be created.public static org.apache.log4j.Level getLogLevel(java.lang.String loggerName)
loggerName
- Name of the logger wants to find the log level.
public static boolean changeLogLevel(java.lang.String loggerName, org.apache.log4j.Level newLogLevel)
loggerName
- Logger name needs to be modified.newLogLevel
- new logging level.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |