public class Log4JHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONSOLE_APPENDER_NAME |
Constructor and Description |
---|
Log4JHelper() |
Modifier and Type | Method and Description |
---|---|
static ArrayList<String> |
getFileAppendersFiles(File log4jConfigurationFile) |
static ArrayList<String> |
getFileAppendersFiles(LoggerRepository loggerRepository)
Returns list of files produced by
FileAppender s defined in a
given LoggerRepository . |
static LoggerRepository |
getNewLoggerRepository(File log4jConfigurationFile)
Creates a
LoggerRepository initialized with given log4j
configuration file without making this configuration active. |
static void |
setDebug(String category,
boolean debug) |
static void |
setQuiet(String appenderName)
Set "quiet" mode: set log level to WARN for the given Log4J appender.
|
public static final String CONSOLE_APPENDER_NAME
public static ArrayList<String> getFileAppendersFiles(LoggerRepository loggerRepository)
FileAppender
s defined in a
given LoggerRepository
. There's no need for the log4j
configuration corresponding to this repository of being active.loggerRepository
- LoggerRepository
to browse looking for
FileAppender
FileAppender
s configured in loggerRepositorypublic static LoggerRepository getNewLoggerRepository(File log4jConfigurationFile)
LoggerRepository
initialized with given log4j
configuration file without making this configuration active.log4jConfigurationFile
- XML Log4J configuration file to load.LoggerRepository
initialized with log4jConfigurationFilepublic static ArrayList<String> getFileAppendersFiles(File log4jConfigurationFile)
log4jConfigurationFile
- FileAppender
s defined in log4jConfigurationFilegetFileAppendersFiles(LoggerRepository)
public static void setDebug(String category, boolean debug)
category
- Log4J category for which to switch debug log leveldebug
- set debug log level to true or falsepublic static void setQuiet(String appenderName)
appenderName
- Log4J appender to switch to WARNCopyright © 2011 Nuxeo SA. All Rights Reserved.