Package com.logicaldoc.util.config
Class LogConfigurator
java.lang.Object
com.logicaldoc.util.config.LogConfigurator
Utility class for manipulating log4j.xml file
- Author:
 - Michael Scholz, Marco Meschieri
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddHtmlAppender(String name) voidvoidaddTextAppender(String name) This method selects all the appender namesSame asgetFile(String, boolean)This method selects a filepath of an appender.Collection<org.jdom2.Element> This method selects all the logger namesgetProperty(String name) voidvoidremoveLogger(String name) Removes a loggervoidAdds or modifies a loggervoidsetLogsRoot(String rootPath) Sets a common path for all file appenders.voidsetRootLevel(String level) booleanwrite() 
- 
Constructor Details
- 
LogConfigurator
public LogConfigurator() 
 - 
 - 
Method Details
- 
getProperty
 - 
getAppenders
This method selects all the appender names- Returns:
 - collection of the log appender names
 
 - 
getLoggers
This method selects all the logger names- Returns:
 - collection of the logger names
 
 - 
getFile
Same asgetFile(String, boolean)- Parameters:
 appender- name of the appender- Returns:
 - the path of the log file
 
 - 
getFile
This method selects a filepath of an appender.- Parameters:
 appender- The appender namereplaceVariables- If true all variables(${var}) in the file path will be substituted- Returns:
 - The log file path
 
 - 
addTextAppender
 - 
addHtmlAppender
 - 
addLogger
 - 
setLogger
Adds or modifies a logger- Parameters:
 name- the logger nameadditivity- the additivity flaglevel- the logger levelappenders- optional list of appenders to assign
 - 
removeLogger
Removes a logger- Parameters:
 name- the logger name
 - 
getRootLevel
 - 
setRootLevel
 - 
setLogsRoot
Sets a common path for all file appenders.- Parameters:
 rootPath- The path to be used
 - 
getLogsRoot
 - 
write
public boolean write() - 
initializeLogging
public void initializeLogging() 
 -