public class ContextualFileHandler extends StreamHandler
The ContextualFileHandler writes the log records in different log files depending on the contextual information.
By default the SimpleFormatter class is used for formatting.
Configuration: By default each ContextualFileHandler is initialized using the following LogManager configuration properties. If properties are not defined (or have invalid values) then the specified default values are used.
| Modifier | Constructor and Description |
|---|---|
|
ContextualFileHandler()
Construct a default ContextualFileHandler.
|
protected |
ContextualFileHandler(String basedir,
String subdir,
String logFilename,
Properties systemProperties) |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
getStringProperty(String name,
String defaultValue) |
void |
publish(LogRecord record)
This method overrides the method
StreamHandler.publish(LogRecord). |
close, flush, isLoggable, setEncoding, setOutputStreamgetEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setFormatter, setLevelprotected ContextualFileHandler(String basedir, String subdir, String logFilename, Properties systemProperties)
public ContextualFileHandler()
throws IOException,
com.ebmwebsourcing.easycommons.properties.PropertiesException
IOException - If the base directory is not set and a the temporary
directory could not be created to write the logscom.ebmwebsourcing.easycommons.properties.PropertiesException - If an error occurs when resolving a place holder in the base
directory propertiespublic void publish(LogRecord record)
StreamHandler.publish(LogRecord). It gets
the file to publish the log record by resolving the place holders present
in the path pattern according the execution context before calling the
inherited method StreamHandler.publish(LogRecord).publish in class StreamHandlerCopyright © 2010-2018 Linagora. All Rights Reserved.