|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.LogManager
ariba.util.log.LogManager
public class LogManager
Helper class with utility methods for creation and access of common appenders, the means to archive log files, and stamdard "lifecycle" methods (setupArguments, processArguments, startup, shutdown, etc.).
Field Summary | |
---|---|
static java.lang.String |
CommonNameForConsole
The common name for the console listener. |
static java.lang.String |
CommonNameForFile
The common name for the file in Parameters.table. |
static java.lang.String |
CommonNameForInspector
The common name for the Inspector log in Parameters.table. |
static java.lang.String |
DefaultLogArchive
The default directory where archived log files will be stored. |
static java.lang.String |
DefaultLogDirectory
The default directory where log files will be stored. |
static java.lang.String |
LogFileSuffix
The standard log filename suffix including extension. |
static java.lang.String |
OptionLogToConsole
The command line-style option name for the console logging switch. |
Fields inherited from class org.apache.log4j.LogManager |
---|
CONFIGURATOR_CLASS_KEY, DEFAULT_CONFIGURATION_FILE, DEFAULT_CONFIGURATION_KEY, DEFAULT_INIT_OVERRIDE_KEY |
Constructor Summary | |
---|---|
LogManager()
|
Method Summary | |
---|---|
static void |
addWarningLogHandler(org.apache.log4j.Appender appender)
Adds an appender to the list of warning log handlers. |
static void |
archiveLogFiles(Parameters params)
Archives registered logging files. |
static org.apache.log4j.Appender |
createConsoleAppender()
Creates a new appender that writes to standard out using the default layout. |
static org.apache.log4j.Appender |
createFileAppender(java.lang.String prefix)
Creates a new appender that writes to the named file using the archiving options. |
static void |
flush()
ToDo: seemingly vestigial method with a handful of callers Should probably remove as it does nothing anyway. |
static java.lang.String |
getArchiveDirectoryName()
Return the directory where archive log files will be stored. |
static org.apache.log4j.Appender |
getCommonConsoleAppender()
Return the shared standard out appender, if one has been defined. |
static org.apache.log4j.Appender |
getCommonFileAppender()
Return the primary file appender, if one has been defined. |
static java.util.List |
getCurrentLoggerList()
Replace the log4j functionality to make sure we only return our Loggers. |
static java.util.Enumeration |
getCurrentLoggers()
Override the log4j method to make sure we only return our Loggers. |
static java.lang.String |
getDirectoryName()
Return the directory where active log files will be stored. |
static java.lang.String |
getEncoding()
Return the standard encoding method for log files. |
static boolean |
loggingInitialized()
ToDo: seemingly vestigial method with a handful of callers Should probably remove--it's hardcoded to return true. |
long |
loggingInitializedAt()
Accessor for timestamp when logging was initialized - pretty close to start of process. |
static void |
processArguments(ArgumentParser arguments)
Processing stage of option argument parsing. |
static void |
removeDefaultConsole()
Deactivates the DefaultConsole appender that is defined as part of the static configuration of log4j. |
static void |
removeWarningLogHandler(org.apache.log4j.Appender appender)
Removes an appender from the list of warning log handlers. |
static void |
setArchiveDirectoryName(java.lang.String archiveDir)
Establish the directory where archive log files will be stored. |
static void |
setCommonConsoleAppender(org.apache.log4j.Appender console,
boolean makeRoot)
Set the shared standard out appender. |
static void |
setCommonFileAppender(org.apache.log4j.Appender file,
boolean makeRoot)
Set the primary file appender. |
static void |
setDirectoryName(java.lang.String dir)
Establish the directory where active log files will be stored. |
static void |
setEncoding(java.lang.String enc)
Set the standard encoding method for log files. |
static void |
setupArguments(ArgumentParser arguments)
First stage of option argument parsing. |
static void |
shutdown()
Indicates the controlling server or command line tool has completed. |
static void |
startup()
Indicates the controlling server or command line tool has completed initialization (of parameters, etc.) and is ready to put the LogManager in "running" mode. |
static AsyncAppender |
wrapInAsyncAppender(org.apache.log4j.Appender appender)
Wrap an appender so it works asynchronously, and will buffer logging events. |
Methods inherited from class org.apache.log4j.LogManager |
---|
exists, getLogger, getLogger, getLogger, getLoggerRepository, getRootLogger, resetConfiguration, setRepositorySelector |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LogFileSuffix
public static final java.lang.String OptionLogToConsole
logToConsole
,
Constant Field Valuespublic static final java.lang.String CommonNameForFile
public static final java.lang.String CommonNameForConsole
public static final java.lang.String CommonNameForInspector
public static final java.lang.String DefaultLogDirectory
public static final java.lang.String DefaultLogArchive
Constructor Detail |
---|
public LogManager()
Method Detail |
---|
public long loggingInitializedAt()
public static java.util.Enumeration getCurrentLoggers()
public static java.util.List getCurrentLoggerList()
public static void setDirectoryName(java.lang.String dir)
dir
- the name (not a path) of the directorypublic static java.lang.String getDirectoryName()
public static void setArchiveDirectoryName(java.lang.String archiveDir)
archiveDir
- the name (not a path) of the directorypublic static java.lang.String getArchiveDirectoryName()
public static void removeDefaultConsole()
public static org.apache.log4j.Appender createConsoleAppender()
public static org.apache.log4j.Appender getCommonConsoleAppender()
public static void setCommonConsoleAppender(org.apache.log4j.Appender console, boolean makeRoot)
console
- the shared standard out appender to setmakeRoot
- if true add this appender to the root loggerpublic static org.apache.log4j.Appender createFileAppender(java.lang.String prefix)
prefix
- the filename prefix
LogFileSuffix
public static org.apache.log4j.Appender getCommonFileAppender()
public static void setCommonFileAppender(org.apache.log4j.Appender file, boolean makeRoot)
file
- the primary file appender to setmakeRoot
- if true add this appender to the root loggerpublic static void addWarningLogHandler(org.apache.log4j.Appender appender)
appender
- the appender to add.public static void removeWarningLogHandler(org.apache.log4j.Appender appender)
appender
- the appender to remove.public static final AsyncAppender wrapInAsyncAppender(org.apache.log4j.Appender appender)
appender
- the appender to be made asynchronous.public static void setEncoding(java.lang.String enc)
enc
- the standard encoding methodpublic static java.lang.String getEncoding()
public static void setupArguments(ArgumentParser arguments)
arguments
- the source of the current command line argumentspublic static void processArguments(ArgumentParser arguments)
arguments
- the source of the current command line argumentspublic static void startup()
public static void archiveLogFiles(Parameters params)
ArchivingAppender
public static void flush()
public static void shutdown()
public static boolean loggingInitialized()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |