@Plugin(name="GLmsLayout",
category="Core",
elementType="layout",
printObject=true)
public final class GLmsLayout
extends org.apache.logging.log4j.core.layout.AbstractStringLayout
<Appenders>
<GLogFile name="LmsAppender" fileName="applog">
<GLogSegmentationStrategy segmentation="4 hrs"/>
<GLogRolloverStrategy expiration="8 days"/>
<GLmsLayout timeFormat="iso8601" messageFormat="full"/>
</GLogFile>
</Appenders>
It has following attributes:"GCTI-nn-nnnnn"
). Its valid value
may be taken as ordinal number of application type defined in the Configuration Server Protocol
enumeration com.genesyslab.platform.configuration.protocol.types.CfgAppType
.
Default value is 0."utc"
,
and "local"
(default)."iso8601"
, "locale"
,
and "time"
(default)."short"
,
"medium"
, "full"
, "shortcsv"
, "shorttsv"
,
and "shortdsv"
. In case of "shortdsv"
value, the plugin uses value of
messageHeaderDelimiter attribute as a delimiter between the short header fields and a log message.
Default value is "medium"
."shortdsv"
,
representing delimiter between the short header fields and a log message.FileHeaderProvider
implementation.
The plugin uses its default implementation if this value is not specified, or it's failed
to instantiate given class. Its possible to switch off the file header usage
with value "off"
or "false"
here.
"true"
(default), exceptions are always written
even if the pattern contains no exception tokens.
org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B extends org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B>>, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer2
Modifier and Type | Field | Description |
---|---|---|
static org.apache.logging.log4j.Marker |
PSDK_LMS_MESSAGE_MARKER |
Every LMS message logged by AppTemplate
LmsEventLogger will bear this marker. |
configuration, eventCount, footer, header, LOGGER
Modifier and Type | Method | Description |
---|---|---|
protected FileHeaderProvider |
createFileHeaderProvider(java.lang.String providerClass) |
|
static GLmsLayout |
createLayout(java.lang.String appName,
java.lang.String hostName,
java.lang.String appType,
int appId,
java.lang.String timeConversion,
java.lang.String timeFormat,
java.lang.String messageFormat,
boolean useNativeLevels,
java.lang.String headerDelimiter,
java.lang.String outputPattern,
java.lang.String customMessageFormat,
java.lang.String fileHeaderProvider,
java.nio.charset.Charset charset,
boolean alwaysWriteExceptions,
boolean noConsoleNoAnsi,
org.apache.logging.log4j.core.config.Configuration config) |
Creates GLmsLayout instance.
|
static GLmsLayout |
createLayout(java.lang.String appName,
java.lang.String hostName,
java.lang.String appType,
int appId,
java.lang.String timeConversion,
java.lang.String timeFormat,
java.lang.String messageFormat,
java.lang.String headerDelimiter,
java.lang.String outputPattern,
java.lang.String customMessageFormat,
java.lang.String fileHeaderProvider,
java.nio.charset.Charset charset,
boolean alwaysWriteExceptions,
boolean noConsoleNoAnsi,
org.apache.logging.log4j.core.config.Configuration config) |
Deprecated.
|
static GLmsLayout |
createLayout(java.lang.String appName,
java.lang.String hostName,
java.lang.String appType,
int appId,
java.lang.String timeConversion,
java.lang.String timeFormat,
java.lang.String messageFormat,
java.lang.String headerDelimiter,
java.lang.String customMessageFormat,
java.lang.String fileHeaderProvider,
java.nio.charset.Charset charset,
boolean alwaysWriteExceptions,
boolean noConsoleNoAnsi,
org.apache.logging.log4j.core.config.Configuration config) |
Deprecated.
|
static GLmsLayout |
createLayout(java.lang.String appName,
java.lang.String hostName,
java.lang.String appType,
int appId,
java.lang.String timeConversion,
java.lang.String timeFormat,
java.lang.String messageFormat,
java.lang.String headerDelimiter,
java.lang.String fileHeaderProvider,
java.nio.charset.Charset charset,
boolean alwaysWriteExceptions,
boolean noConsoleNoAnsi,
org.apache.logging.log4j.core.config.Configuration config) |
Deprecated.
|
java.util.Map<java.lang.String,java.lang.String> |
getContentFormat() |
Gets this PatternLayout's content format.
|
FileHeaderProvider |
getFileHeaderProvider() |
Returns reference to the FileHeaderProvider.
|
byte[] |
getHeader() |
|
void |
setUseExtHeaderGeneration(boolean useExtHeaderGeneration) |
|
java.lang.String |
toSerializable(org.apache.logging.log4j.core.LogEvent event) |
Formats a logging event to a writer.
|
java.lang.String |
toString() |
encode, getConfiguration, markEvent
getBytes, getCharset, getContentType, getFooter, getFooterSerializer, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSize
public static final org.apache.logging.log4j.Marker PSDK_LMS_MESSAGE_MARKER
LmsEventLogger
will bear this marker.
It allows marker-aware implementations to perform specific processing on the localized messages.public java.util.Map<java.lang.String,java.lang.String> getContentFormat()
getContentFormat
in class org.apache.logging.log4j.core.layout.AbstractLayout<java.lang.String>
PatternLayout.getContentFormat()
public FileHeaderProvider getFileHeaderProvider()
public void setUseExtHeaderGeneration(boolean useExtHeaderGeneration)
public byte[] getHeader()
getHeader
in class org.apache.logging.log4j.core.layout.AbstractStringLayout
public java.lang.String toSerializable(org.apache.logging.log4j.core.LogEvent event)
event
- logging event to be formatted.public java.lang.String toString()
toString
in class java.lang.Object
@PluginFactory public static GLmsLayout createLayout(@PluginAttribute(value="appName",defaultString="Application") java.lang.String appName, @PluginAttribute("hostName") java.lang.String hostName, @PluginAttribute("appType") java.lang.String appType, @PluginAttribute("appId") int appId, @PluginAttribute("timeConversion") java.lang.String timeConversion, @PluginAttribute("timeFormat") java.lang.String timeFormat, @PluginAttribute("messageFormat") java.lang.String messageFormat, @PluginAttribute(value="useNativeLevels",defaultBoolean=false) boolean useNativeLevels, @PluginAttribute("messageHeaderDelimiter") java.lang.String headerDelimiter, @PluginAttribute("outputPattern") java.lang.String outputPattern, @PluginAttribute("customMessageFormat") java.lang.String customMessageFormat, @PluginAttribute("fileHeaderProvider") java.lang.String fileHeaderProvider, @PluginAttribute(value="charset",defaultString="UTF-8") java.nio.charset.Charset charset, @PluginAttribute(value="alwaysWriteExceptions",defaultBoolean=true) boolean alwaysWriteExceptions, @PluginAttribute(value="noConsoleNoAnsi",defaultBoolean=false) boolean noConsoleNoAnsi, @PluginConfiguration org.apache.logging.log4j.core.config.Configuration config)
appName
- the name of "this" application to be used in the header of the log files.
Default value is "Application".hostName
- the host name value to be used in the header of the log files;
Log4j tries to obtain it as the local host name if this value is not specified.appType
- the type of the application to be used in the header of the log files,
and in the LMS messages IDs. Default value is 0.appId
- the application DBID value to be used in the header of the log files.
Default value is 0.timeConversion
- the time conversion parameter, possible values are: "utc"
,
and "local"
(default).timeFormat
- the time format, possible values are: "iso8601"
, "locale"
,
and "time"
(default).messageFormat
- the format of log messages header. Possible values are: "short"
,
"medium"
, "full"
, "shortcsv"
, "shorttsv"
,
and "shortdsv"
. In case of "shortdsv"
value,
the plugin uses value of headerDelimiter attribute as a delimiter
between the short header fields and a log message. Default value is "medium"
.useNativeLevels
- this parameter enables usage of native logger levels like "Error", "Warn", etc
instead of common LMS levels like "Standard", "Interaction", etc, while formatting non-LMS events.headerDelimiter
- it's used when messageFormat is equal to "shortdsv"
,
representing delimiter between the short header fields and a log message.outputPattern
- the pattern layout definition for "custom" messageFormat.customMessageFormat
- the pattern layout definition for "custom" messageFormat - its used when
no "outputPattern" specified. This format is prefixed with timestamp of given "timeFormat",
and the log level.fileHeaderProvider
- fully qualified class name of FileHeaderProvider
implementation.
The plugin uses its default implementation if this value is not specified.charset
- the charset encoding to write the log files with. Default value is "UTF-8".alwaysWriteExceptions
- if its value is "true"
(default), exceptions are always written
even if the pattern contains no exception tokens.noConsoleNoAnsi
- if its value is "true"
(default is false) and
System.console()
is null, do not output ANSI escape codes.config
- the Configuration. Some Converters require access to the Interpolator.@Deprecated public static GLmsLayout createLayout(java.lang.String appName, java.lang.String hostName, java.lang.String appType, int appId, java.lang.String timeConversion, java.lang.String timeFormat, java.lang.String messageFormat, java.lang.String headerDelimiter, java.lang.String fileHeaderProvider, java.nio.charset.Charset charset, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, org.apache.logging.log4j.core.config.Configuration config)
@Deprecated public static GLmsLayout createLayout(java.lang.String appName, java.lang.String hostName, java.lang.String appType, int appId, java.lang.String timeConversion, java.lang.String timeFormat, java.lang.String messageFormat, java.lang.String headerDelimiter, java.lang.String customMessageFormat, java.lang.String fileHeaderProvider, java.nio.charset.Charset charset, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, org.apache.logging.log4j.core.config.Configuration config)
@Deprecated public static GLmsLayout createLayout(java.lang.String appName, java.lang.String hostName, java.lang.String appType, int appId, java.lang.String timeConversion, java.lang.String timeFormat, java.lang.String messageFormat, java.lang.String headerDelimiter, java.lang.String outputPattern, java.lang.String customMessageFormat, java.lang.String fileHeaderProvider, java.nio.charset.Charset charset, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, org.apache.logging.log4j.core.config.Configuration config)
protected FileHeaderProvider createFileHeaderProvider(java.lang.String providerClass)
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.