Platform SDK Java 8.5 API Reference

com.genesyslab.platform.apptemplate.log4j2plugin
Class GLogSegmentationStrategy

java.lang.Object
  extended by com.genesyslab.platform.apptemplate.log4j2plugin.GLogSegmentationStrategy
All Implemented Interfaces:
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

The Log4j2 log files segmentation strategy (triggering policy) by original Genesys Loglib approach. It has following parameters:

For example:
 <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>
 


Nested Class Summary
static class GLogSegmentationStrategy.SegmentationStrategy
          Describes the possible type of log file segmentation.
 
Field Summary
protected static org.apache.logging.log4j.status.StatusLogger LOGGER
           
protected  GLogSegmentationStrategy.SegmentationStrategy segmStrategy
           
protected  java.lang.Long sizeLimit
           
protected  java.lang.Long timeLimit
           
 
Constructor Summary
protected GLogSegmentationStrategy(GLogSegmentationStrategy.SegmentationStrategy segmStrategy, int size)
          Constructs a new instance.
 
Method Summary
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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

segmStrategy

protected final GLogSegmentationStrategy.SegmentationStrategy segmStrategy

sizeLimit

protected final java.lang.Long sizeLimit

timeLimit

protected final java.lang.Long timeLimit

LOGGER

protected static final org.apache.logging.log4j.status.StatusLogger LOGGER
Constructor Detail

GLogSegmentationStrategy

protected GLogSegmentationStrategy(GLogSegmentationStrategy.SegmentationStrategy segmStrategy,
                                   int size)
Constructs a new instance.

Parameters:
segmStrategy - the segmentation strategy.
size - the segment size.
Method Detail

createStrategy

@PluginFactory
public static GLogSegmentationStrategy createStrategy(@PluginAttribute(value="segmentation")
                                                                    java.lang.String segmentation,
                                                                    @PluginAttribute(value="segmStrategy")
                                                                    java.lang.String segmStrategy,
                                                                    @PluginAttribute(value="segmSize")
                                                                    java.lang.Integer segmSize,
                                                                    @PluginConfiguration
                                                                    org.apache.logging.log4j.core.config.Configuration config)
Creates the GLogSegmentationStrategy.

Parameters:
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.
Returns:
A GLogSegmentationStrategy.

getStrategy

public GLogSegmentationStrategy.SegmentationStrategy getStrategy()

getSizeLimit

public java.lang.Long getSizeLimit()

getTimeLimit

public java.lang.Long getTimeLimit()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

initialize

public void initialize(org.apache.logging.log4j.core.appender.rolling.RollingFileManager manager)
Specified by:
initialize in interface org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy

isTriggeringEvent

public boolean isTriggeringEvent(org.apache.logging.log4j.core.LogEvent event)
Specified by:
isTriggeringEvent in interface org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.