@Deprecated public interface LogConfig extends Config, LogDescription
Any number of different Log definitions can be set up.
LogDescription.LogLevel
Modifier and Type | Method and Description |
---|---|
int |
getFileCount()
Deprecated.
Specifies the number of log files to use.
|
void |
setDateFormat(String dateFormat)
Deprecated.
Specifies a date format to use for formatting dates used in the %d part
of the file pattern (see {link
setFilePattern(String) ). |
void |
setFileAppend(boolean append)
Deprecated.
Sets the file append option.
|
void |
setFileCount(int fileCount)
Deprecated.
Sets the file count.
|
void |
setFileLimit(int limit)
Deprecated.
Sets the file limit.
|
void |
setFilePattern(String filePattern)
Deprecated.
Sets the file pattern.
|
void |
setLevel(LogDescription.LogLevel level)
Deprecated.
Sets the starting log level.
|
void |
setLogDirectory(String directory)
Deprecated.
Sets the log directory.
|
void |
setRotationPeriod(int period,
TimeUnit unit)
Deprecated.
Set the rotation period of the log file.
|
void |
setXmlFormat(boolean xmlFormat)
Deprecated.
Sets the XML format option.
|
getDateFormat, getFileLimit, getFilePattern, getLevel, getLogDirectory, getName, getRotationPeriod, getRotationTimeUnit, isFileAppend, isXmlFormat
void setLogDirectory(String directory) throws ConfigException
The name of the directory to which this log file will be written.
If this is not set explicitly then the default log directory of the owner will be used.
directory
- the log directoryConfigException
- if unable to set the propertyvoid setFilePattern(String filePattern) throws ConfigException
The following may be used within the file name specification:
/ - specifies the local pathname separator.
%t - the system temporary directory
%g - the generation number to distinguish rotated logs
%h - the value of the "user.home" system property
%s - System type - e.g. 'Diffusion'
%n - System name as defined in Server.xml
%d - Date as specified bysetDateFormat(String)
%% - translates to a single percent sign "%"
If this is not explicitly specified, the default file pattern of "%s.log" is assumed.
filePattern
- the file patternConfigException
- if unable to set the propertyvoid setLevel(LogDescription.LogLevel level) throws ConfigException
SLF4J Log levels are also supported.
If not specified,
INFO
is assumed.
level
- the initial log levelConfigException
- if unable to set the propertyvoid setXmlFormat(boolean xmlFormat) throws ConfigException
Indicates whether the log file should be output in XML format.
If not specified, log will not be in XML format.
xmlFormat
- true for XML formatConfigException
- if unable to set the propertyvoid setDateFormat(String dateFormat) throws ConfigException
setFilePattern(String)
).
The date format should be a pattern as defined by
SimpleDateFormat
.
If a format is not specified, a default of "yyyy-MM-dd" is used.
dateFormat
- the date format to useConfigException
- if unable to set the date formatvoid setFileLimit(int limit) throws ConfigException
Specifies an approximate maximum amount to write (in bytes) to any one log file. If this is zero (the default), there is no limit.
limit
- the file limit in bytes or 0 for no limitConfigException
- if unable to set the propertyvoid setFileAppend(boolean append) throws ConfigException
Specifies whether log records should be appended to existing log files. If false, files are overwritten.
If not specified, false is assumed.
append
- true to append, false to overwriteConfigException
- if unable to set the propertyvoid setFileCount(int fileCount) throws ConfigException
Specifies the number of log files to use. Must be at least 1.
If not specified, 1 is assumed.
fileCount
- the file countConfigException
- if unable to set the propertyint getFileCount()
LogDescription
getFileCount
in interface LogDescription
LogDescription.getFileCount()
void setRotationPeriod(int period, TimeUnit unit) throws ConfigException
This method accepts an integer and a TimeUnit, specifying the duration a log file exists for, after which it will be rotated.
period
- the time period over which log files exist before rotationunit
- the TimeUnit defining the rotation periodConfigException
- if unable to set the propertyCopyright © 2021 Push Technology Ltd. All Rights Reserved.