public class Log4JUtility
extends java.lang.Object
Constructor and Description |
---|
Log4JUtility() |
Modifier and Type | Method and Description |
---|---|
static void |
configureLog4j(java.util.Properties props)
Configure log4j from a properties object.
|
static void |
configureLog4j(java.util.Properties props,
java.lang.String baseLogOutputDirectory)
Configure log4j from a properties object.
|
static void |
configureLog4j(java.lang.String log4JConfigFile)
Configure log4j from a config file.
|
static void |
configureLog4j(java.lang.String log4JConfigFile,
java.lang.String baseLogOutputDirectory)
Method to read in a log4j config file, modify every property that ends
with "File" such that the baseFilePath value is prefixed onto it, and
then configure log4j with the results.
|
static void |
configureLog4JFromPathSpecifiedInProperties(java.util.Properties properties,
java.lang.String log4JConfigFilePropertyName,
boolean setLogOutputBaseDirToPropertiesPath)
Configure log4j with the a config file specified by a value in a
properties object.
|
public static void configureLog4JFromPathSpecifiedInProperties(java.util.Properties properties, java.lang.String log4JConfigFilePropertyName, boolean setLogOutputBaseDirToPropertiesPath) throws java.lang.Exception
properties
- The properties object to look in for the file name of the
log4j config file.log4JConfigFilePropertyName
- The property name in the properties object that has a
corresponding value with the path of the log4j config file.setLogOutputBaseDirToPropertiesPath
- Should the log4j config file be modifed so that all appenders
that end with "File" have the base directory of the location
of the properties file prepended to them? If true - this also
requires having the 'propertiesFileParentFolder' value set.java.lang.Exception
public static void configureLog4j(java.lang.String log4JConfigFile, java.lang.String baseLogOutputDirectory) throws java.io.IOException
log4JConfigFile
- The file (or URL) to read the log4j configuration frombaseFilePath
- The path to prefix onto all values that end with "File" in the
log4j config file.java.io.IOException
public static void configureLog4j(java.lang.String log4JConfigFile) throws java.io.IOException
log4JConfigFile
- File (or URL) to use to configure log4j.java.io.IOException
public static void configureLog4j(java.util.Properties props)
props
- The log4j propertiespublic static void configureLog4j(java.util.Properties props, java.lang.String baseLogOutputDirectory)
props
- properties to load.baseLogOutputDirectory
- directory path to prefix onto items ending with "File"