Package org.nuxeo.log4j
Class Log4JHelper
java.lang.Object
org.nuxeo.log4j.Log4JHelper
Provides helper methods for working with log4j
- Since:
- 5.4.2
- Author:
- jcarsique
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFileAppendersFileNames
(File log4jConfigurationFile) 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
Set DEBUG level on the given logger.
-
Constructor Details
-
Log4JHelper
public Log4JHelper()
-
-
Method Details
-
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
- Parameters:
log4jConfigurationFile
- the XML configuration file to load- Returns:
FileAppender
s defined in log4jConfigurationFile- Since:
- 10.3
- See Also:
-
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
-