|
|||||||||
| 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 String |
CommonNameForConsole
The common name for the console listener. |
static String |
CommonNameForFile
The common name for the file in Parameters.table. |
static String |
CommonNameForInspector
The common name for the Inspector log in Parameters.table. |
static String |
DefaultLogArchive
The default directory where archived log files will be stored. |
static String |
DefaultLogDirectory
The default directory where log files will be stored. |
static String |
LogFileSuffix
The standard log filename suffix including extension. |
static 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()
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(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 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 List |
getCurrentLoggerList()
Replace the log4j functionality to make sure we only return our Loggers. |
static Enumeration |
getCurrentLoggers()
Override the log4j method to make sure we only return our Loggers. |
static String |
getDirectoryName()
Return the directory where active log files will be stored. |
static 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(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(String dir)
Establish the directory where active log files will be stored. |
static void |
setEncoding(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 String LogFileSuffix
public static final String OptionLogToConsole
logToConsole,
Constant Field Valuespublic static final String CommonNameForFile
public static final String CommonNameForConsole
public static final String CommonNameForInspector
public static final String DefaultLogDirectory
public static final String DefaultLogArchive
| Constructor Detail |
|---|
public LogManager()
| Method Detail |
|---|
public long loggingInitializedAt()
public static Enumeration getCurrentLoggers()
public static List getCurrentLoggerList()
public static void setDirectoryName(String dir)
dir - the name (not a path) of the directorypublic static String getDirectoryName()
public static void setArchiveDirectoryName(String archiveDir)
archiveDir - the name (not a path) of the directorypublic static 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(String prefix)
prefix - the filename prefix
LogFileSuffixpublic 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(String enc)
enc - the standard encoding methodpublic static 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()
ArchivingAppenderpublic 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 | ||||||||