org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy
@Plugin(name="GLogSegmentationStrategy",
category="Core",
printObject=true)
public class GLogSegmentationStrategy
extends java.lang.Object
implements org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy
"<number> hrs"
, "<number>[ kb]"
,
"<number>[ mb]"
, or "false".OFF
',
'TIME_BASED
', 'SIZE_KB
', and 'SIZE_MB
'.
It is used if segmentation is not specified.
<Appenders>
<GLogFile name="LmsAppender" fileName="applog">
<GLogSegmentationStrategy segmentation="4 hrs"/>
<GLogRolloverStrategy expiration="8 days"/>
<MarkerFilter marker="PSDK_LMS_MESSAGE" onMatch="ACCEPT" onMismatch="DENY"/>
<GLmsLayout timeFormat="iso8601" messageFormat="full"/>
</GLogFile>
</Appenders>
or
<Appenders>
<RollingFile name="LmsAppender" fileName="applog.log" filePattern="applog.%d{yyyyMMdd_HHmmss_SSS}.log">
<GLogSegmentationStrategy segmStrategy="SIZE_MB" segmSize="10"/>
<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 |
---|---|---|
static class |
GLogSegmentationStrategy.SegmentationStrategy |
Describes the possible type of log file segmentation.
|
Modifier and Type | Field | Description |
---|---|---|
protected static org.apache.logging.log4j.status.StatusLogger |
LOGGER |
|
protected GLogSegmentationStrategy.SegmentationStrategy |
segmStrategy |
|
protected java.lang.Long |
sizeLimit |
|
protected java.lang.Long |
timeLimit |
Modifier | Constructor | Description |
---|---|---|
protected |
GLogSegmentationStrategy(GLogSegmentationStrategy.SegmentationStrategy segmStrategy,
int size) |
Constructs a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
static GLogSegmentationStrategy |
createStrategy(java.lang.String segmentation,
java.lang.String segmStrategy,
java.lang.Integer segmSize,
org.apache.logging.log4j.core.config.Configuration config) |
Creates the GLogSegmentationStrategy.
|
java.lang.Long |
getSizeLimit() |
|
GLogSegmentationStrategy.SegmentationStrategy |
getStrategy() |
|
java.lang.Long |
getTimeLimit() |
|
void |
initialize(org.apache.logging.log4j.core.appender.rolling.RollingFileManager manager) |
|
boolean |
isTriggeringEvent(org.apache.logging.log4j.core.LogEvent event) |
|
java.lang.String |
toString() |
protected final GLogSegmentationStrategy.SegmentationStrategy segmStrategy
protected final java.lang.Long sizeLimit
protected final java.lang.Long timeLimit
protected static final org.apache.logging.log4j.status.StatusLogger LOGGER
protected GLogSegmentationStrategy(GLogSegmentationStrategy.SegmentationStrategy segmStrategy, int size)
segmStrategy
- the segmentation strategy.size
- the segment size.@PluginFactory public static GLogSegmentationStrategy createStrategy(@PluginAttribute("segmentation") java.lang.String segmentation, @PluginAttribute("segmStrategy") java.lang.String segmStrategy, @PluginAttribute("segmSize") java.lang.Integer segmSize, @PluginConfiguration org.apache.logging.log4j.core.config.Configuration config)
segmentation
- The segmentation configuration. Format is following:
"<number> hrs"
,
"<number> mb"
,
"<number>[ kb]"
,
or "off"/"false".segmStrategy
- The segmentation strategy type. Possible values are: 'OFF
',
'TIME_BASED
', 'SIZE_MB
',
and 'SIZE_KB
'. It is used if segmentation is not specified.segmSize
- The segmentation strategy limitation parameter. It is used if segmentation
is not specified.config
- The Configuration.public GLogSegmentationStrategy.SegmentationStrategy getStrategy()
public java.lang.Long getSizeLimit()
public java.lang.Long getTimeLimit()
public java.lang.String toString()
toString
in class java.lang.Object
public void initialize(org.apache.logging.log4j.core.appender.rolling.RollingFileManager manager)
initialize
in interface org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy
public boolean isTriggeringEvent(org.apache.logging.log4j.core.LogEvent event)
isTriggeringEvent
in interface org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.