Package org.nuxeo.log4j
Class Log4JHelper
- java.lang.Object
-
- org.nuxeo.log4j.Log4JHelper
-
public class Log4JHelper extends Object
Provides helper methods for working with log4j- Since:
- 5.4.2
- Author:
- jcarsique
-
-
Constructor Summary
Constructors Constructor Description Log4JHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>
getFileAppendersFileNames(File log4jConfigurationFile)
static List<String>
getFileAppendersFileNames(org.apache.logging.log4j.core.config.Configuration configuration)
Returns list of files produced byFileAppender
s defined in a givenConfiguration
.static org.apache.logging.log4j.core.config.Configuration
newConfiguration(File log4jConfigurationFile)
Creates aConfiguration
initialized with given log4j configuration file without making this configuration active.static void
setLevel(String[] loggerNames, org.apache.logging.log4j.Level level, boolean includeChildren)
Set DEBUG level on the given logger.
-
-
-
Method Detail
-
getFileAppendersFileNames
public static List<String> getFileAppendersFileNames(org.apache.logging.log4j.core.config.Configuration configuration)
Returns list of files produced byFileAppender
s defined in a givenConfiguration
. There's no need for the log4j configuration corresponding to this repository of being active.- Parameters:
configuration
- theConfiguration
to browse looking forFileAppender
- Returns:
FileAppender
s present in configuration- Since:
- 10.3
-
newConfiguration
public static org.apache.logging.log4j.core.config.Configuration newConfiguration(File log4jConfigurationFile)
Creates aConfiguration
initialized with given log4j configuration file without making this configuration active.- Parameters:
log4jConfigurationFile
- the XML configuration file to load- Returns:
Configuration
initialized with log4jConfigurationFile- Since:
- 10.3
-
getFileAppendersFileNames
public static List<String> getFileAppendersFileNames(File log4jConfigurationFile)
- Parameters:
log4jConfigurationFile
- the XML configuration file to load- Returns:
FileAppender
s defined in log4jConfigurationFile- Since:
- 10.3
- See Also:
getFileAppendersFileNames(Configuration)
-
setLevel
public static void setLevel(String[] loggerNames, org.apache.logging.log4j.Level level, boolean includeChildren)
Set DEBUG level on the given logger.- Parameters:
loggerNames
- the logger names to change levellevel
- the level to setincludeChildren
- whether or not to change children levels- Since:
- 10.3
-
-