org.apache.logging.log4j.core.appender.rolling.DirectFileRolloverStrategy
, org.apache.logging.log4j.core.appender.rolling.RolloverStrategy
@Plugin(name="GLogRolloverStrategy",
category="Core",
printObject=true)
public class GLogRolloverStrategy
extends java.lang.Object
implements org.apache.logging.log4j.core.appender.rolling.RolloverStrategy, org.apache.logging.log4j.core.appender.rolling.DirectFileRolloverStrategy
"<number> days"
, "<number>[ files]"
,
or "off"/"false".OFF
',
'TIME_BASED
', and 'NUMBER_OF_FILES
'.
It is used if expConfig is not specified.
<Appenders>
<GLogFile name="LmsAppender" fileName="applog">
<GLogSegmentationStrategy segmentation="4 hrs"/>
<GLogRolloverStrategy expiration="8 files"/>
<MarkerFilter marker="PSDK_LMS_MESSAGE" onMatch="ACCEPT" onMismatch="DENY"/>
<GLmsLayout timeFormat="iso8601" messageFormat="full"/>
</GLogFile>
</Appenders>
or
<Appenders>
<RollingFile name="LmsAppender" fileName="applog" filePattern="applog.%d{yyyyMMdd_HHmmss_SSS}.log">
<GLogSegmentationStrategy segmentation="4 hrs"/>
<GLogRolloverStrategy expStrategy="NUMBER_OF_FILES" expLimit="10"/>
<MarkerFilter marker="PSDK_LMS_MESSAGE" onMatch="ACCEPT" onMismatch="DENY"/>
<GLmsLayout timeFormat="iso8601" messageFormat="full"/>
</RollingFile>
</Appenders>
Modifier and Type | Class | Description |
---|---|---|
protected static class |
GLogRolloverStrategy.CompressionMethod |
|
static class |
GLogRolloverStrategy.ExpirationStrategy |
Describes the possible type of log file expiration.
|
Modifier and Type | Field | Description |
---|---|---|
protected GLogRolloverStrategy.CompressionMethod |
compression |
|
protected org.apache.logging.log4j.core.config.Configuration |
config |
|
protected int |
expLimit |
|
protected GLogRolloverStrategy.ExpirationStrategy |
expStrategy |
|
static java.lang.String |
GZ_EXT |
|
protected java.lang.String |
logfilesExt |
|
protected static org.apache.logging.log4j.status.StatusLogger |
LOGGER |
|
static java.lang.String |
ZIP_EXT |
Modifier | Constructor | Description |
---|---|---|
protected |
GLogRolloverStrategy(GLogRolloverStrategy.ExpirationStrategy expStrategy,
int expLimit,
java.lang.String logfilesExt,
GLogRolloverStrategy.CompressionMethod compression,
org.apache.logging.log4j.core.config.Configuration config) |
Constructs a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
void |
clearCurrentFileName() |
|
static GLogRolloverStrategy |
createStrategy(java.lang.String expiration,
java.lang.String expStrategy,
java.lang.Integer expLimit,
java.lang.String logfilesExt,
java.lang.String compression,
org.apache.logging.log4j.core.config.Configuration config) |
Creates an instance of GLogRolloverStrategy.
|
static GLogRolloverStrategy |
createStrategy(java.lang.String expiration,
java.lang.String expStrategy,
java.lang.Integer expLimit,
java.lang.String logfilesExt,
org.apache.logging.log4j.core.config.Configuration config) |
Deprecated.
|
protected org.apache.logging.log4j.core.appender.rolling.action.Action |
getCompressionAction(java.lang.String fname) |
|
java.lang.String |
getCurrentFileName(org.apache.logging.log4j.core.appender.rolling.RollingFileManager manager) |
|
protected java.io.File |
getZipFile(java.lang.String fname) |
|
org.apache.logging.log4j.core.appender.rolling.RolloverDescription |
rollover(org.apache.logging.log4j.core.appender.rolling.RollingFileManager manager) |
Performs the rollover.
|
java.lang.String |
toString() |
public static final java.lang.String GZ_EXT
public static final java.lang.String ZIP_EXT
protected final org.apache.logging.log4j.core.config.Configuration config
protected final GLogRolloverStrategy.ExpirationStrategy expStrategy
protected final int expLimit
protected final java.lang.String logfilesExt
protected final GLogRolloverStrategy.CompressionMethod compression
protected static final org.apache.logging.log4j.status.StatusLogger LOGGER
protected GLogRolloverStrategy(GLogRolloverStrategy.ExpirationStrategy expStrategy, int expLimit, java.lang.String logfilesExt, GLogRolloverStrategy.CompressionMethod compression, org.apache.logging.log4j.core.config.Configuration config)
expStrategy
- the expiration strategy.expLimit
- the expiration limitation value.logfilesExt
- the log files extension.subst
- the strings substitutor from the logging configuration.@PluginFactory public static GLogRolloverStrategy createStrategy(@PluginAttribute("expiration") java.lang.String expiration, @PluginAttribute("expStrategy") java.lang.String expStrategy, @PluginAttribute("expLimit") java.lang.Integer expLimit, @PluginAttribute("logfilesExt") java.lang.String logfilesExt, @PluginAttribute("compression") java.lang.String compression, @PluginConfiguration org.apache.logging.log4j.core.config.Configuration config)
expiration
- the expiration configuration. Format is following:
"<number> days"
,
"<number>[ files]"
,
or "off"/"false".expStrategy
- the expiration strategy type. Possible values are: 'OFF
',
'TIME_BASED
', and 'NUMBER_OF_FILES
'.
It is used if expConfig is not specified.expLimit
- the expiration strategy limitation parameter. It is used if expConfig is not specified.logfilesExt
- the logfiles extension.compression
- the historical files compression method.config
- the Configuration.@Deprecated public static GLogRolloverStrategy createStrategy(java.lang.String expiration, java.lang.String expStrategy, java.lang.Integer expLimit, java.lang.String logfilesExt, org.apache.logging.log4j.core.config.Configuration config)
public java.lang.String getCurrentFileName(org.apache.logging.log4j.core.appender.rolling.RollingFileManager manager)
getCurrentFileName
in interface org.apache.logging.log4j.core.appender.rolling.DirectFileRolloverStrategy
public void clearCurrentFileName()
clearCurrentFileName
in interface org.apache.logging.log4j.core.appender.rolling.DirectFileRolloverStrategy
public org.apache.logging.log4j.core.appender.rolling.RolloverDescription rollover(org.apache.logging.log4j.core.appender.rolling.RollingFileManager manager) throws java.lang.SecurityException
rollover
in interface org.apache.logging.log4j.core.appender.rolling.RolloverStrategy
manager
- The RollingFileManager name for current active log file.java.lang.SecurityException
- if an error occurs.protected org.apache.logging.log4j.core.appender.rolling.action.Action getCompressionAction(java.lang.String fname)
protected java.io.File getZipFile(java.lang.String fname)
public java.lang.String toString()
toString
in class java.lang.Object
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.