Platform SDK Java 8.5 API Reference

com.genesyslab.platform.apptemplate.lmslogger.log4j2
Class Log4j2LmsEventLogger

java.lang.Object
  extended by com.genesyslab.platform.commons.log.AbstractLogger
      extended by com.genesyslab.platform.apptemplate.lmslogger.AbstractLmsEventLogger
          extended by com.genesyslab.platform.apptemplate.lmslogger.log4j2.Log4j2LmsEventLogger
All Implemented Interfaces:
ILoggerEx, LmsEventLogger, ILogger

public class Log4j2LmsEventLogger
extends AbstractLmsEventLogger

Log4j 2.x based implementation of LmsEventLogger.

See Also:
Log4j2LmsLoggerFactory

Nested Class Summary
 
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.log.AbstractLogger
AbstractLogger.Level
 
Field Summary
static org.apache.logging.log4j.Marker PSDK_INT_MESSAGE_MARKER
           
static org.apache.logging.log4j.Marker PSDK_LMS_MESSAGE_MARKER
          Every LMS message logged by this LmsLogger will bear this marker.
static org.apache.logging.log4j.Marker PSDK_MESSAGE_MARKER
           
 
Fields inherited from class com.genesyslab.platform.apptemplate.lmslogger.AbstractLmsEventLogger
CTX_ATTRMAP_PREFIX, CTX_LMSATTR_CATEGORY, CTX_LMSATTR_ID, CTX_LMSATTR_LEVEL, CTX_LMSATTR_NAME, CTX_LMSATTR_PREFIX, DEFAULT_LMS_EVENT, lmsMessages, LOG_WRAPPER_FQCN, printAttributes
 
Fields inherited from interface com.genesyslab.platform.apptemplate.lmslogger.LmsEventLogger
STR_PSDK_LMS_ALARM_MESSAGE_MARKER, STR_PSDK_LMS_MESSAGE_MARKER
 
Constructor Summary
protected Log4j2LmsEventLogger(LmsMessageConveyor imc, org.apache.logging.log4j.Logger logger)
           
 
Method Summary
 ILogger createChildLogger(java.lang.String name)
          Creates new child logger.
protected  void doLogEvent(LogCategory category, AbstractLogger.Level logLevel, LmsMessageTemplate key, java.lang.Object... args)
          Log a localized message.
protected static LogLevel getLmsLogLevel(LmsLogLevel lmsLevel)
           
protected static org.apache.logging.log4j.Level getLogLevel(AbstractLogger.Level logLevel)
           
protected static org.apache.logging.log4j.Level getLogLevel(LmsLogLevel lmsLogLevel)
           
 boolean isDebug()
          Checks whether this Logger is enabled for the DEBUG Level.
 boolean isError()
          Checks whether this Logger is enabled for the ERROR Level.
 boolean isFatalError()
          Checks whether this Logger is enabled for the FATAL ERROR level.
 boolean isInfo()
          Checks whether this Logger is enabled for the INFO Level.
 boolean isWarn()
          Checks whether this Logger is enabled for the WARNING Level.
protected  void log(java.lang.Object message, java.lang.Throwable thr, AbstractLogger.Level level)
           
protected  void logArgs(java.lang.String message, java.lang.Object args, AbstractLogger.Level level)
           
 
Methods inherited from class com.genesyslab.platform.apptemplate.lmslogger.AbstractLmsEventLogger
debug, debug, debug, debug, debug, error, error, error, error, error, fatal, fatal, fatal, fatalError, fatalError, fatalError, fatalError, getThrowableArg, info, info, info, info, info, log, log, log, log, trace, warn, warn, warn, warn, warn
 
Methods inherited from class com.genesyslab.platform.commons.log.AbstractLogger
debugFormat, errorFormat, fatalErrorFormat, formatMessage, infoFormat, warnFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.genesyslab.platform.commons.log.ILogger
debugFormat, errorFormat, fatalErrorFormat, infoFormat, warnFormat
 

Field Detail

PSDK_LMS_MESSAGE_MARKER

public static final org.apache.logging.log4j.Marker PSDK_LMS_MESSAGE_MARKER
Every LMS message logged by this LmsLogger will bear this marker. It allows marker-aware implementations to perform specific processing on the localized messages.


PSDK_MESSAGE_MARKER

public static final org.apache.logging.log4j.Marker PSDK_MESSAGE_MARKER

PSDK_INT_MESSAGE_MARKER

public static final org.apache.logging.log4j.Marker PSDK_INT_MESSAGE_MARKER
Constructor Detail

Log4j2LmsEventLogger

protected Log4j2LmsEventLogger(LmsMessageConveyor imc,
                               org.apache.logging.log4j.Logger logger)
Method Detail

createChildLogger

public ILogger createChildLogger(java.lang.String name)
Description copied from interface: ILogger
Creates new child logger. Name of a child logger usually looks like "[this-logger-name].[child-name]".

Parameters:
name - the child name for the new logger
Returns:
new ILogger instance

isDebug

public boolean isDebug()
Description copied from interface: ILogger
Checks whether this Logger is enabled for the DEBUG Level.

Returns:
boolean - true if this Logger is enabled for level DEBUG, false otherwise.

isInfo

public boolean isInfo()
Description copied from interface: ILogger
Checks whether this Logger is enabled for the INFO Level.

Returns:
boolean - true if this Logger is enabled for level INFO, false otherwise.

isWarn

public boolean isWarn()
Description copied from interface: ILogger
Checks whether this Logger is enabled for the WARNING Level.

Returns:
boolean - true if this Logger is enabled for level WARNING, false otherwise.

isError

public boolean isError()
Description copied from interface: ILogger
Checks whether this Logger is enabled for the ERROR Level.

Returns:
boolean - true if this Logger is enabled for level ERROR, false otherwise.

isFatalError

public boolean isFatalError()
Description copied from interface: ILogger
Checks whether this Logger is enabled for the FATAL ERROR level.

Note: Some of PSDK supported logging frameworks (namely "Slf4J" and "java.util.logging") do not support FATAL ERROR messages level.
So, in Slf4J logging adapter PSDK marks such messages with "PSDK_FATAL_MESSAGE" marker.
And in java.util.logging adapter this level is processed as ERROR (SEVERE).

Returns:
boolean - true if this Logger is enabled for level FATAL ERROR, false otherwise.

doLogEvent

protected void doLogEvent(LogCategory category,
                          AbstractLogger.Level logLevel,
                          LmsMessageTemplate key,
                          java.lang.Object... args)
Log a localized message.

Specified by:
doLogEvent in class AbstractLmsEventLogger
Parameters:
key - the key used for localization.
args - optional arguments.
category - the log event category.
logLevel - the PSDK log level value.

log

protected void log(java.lang.Object message,
                   java.lang.Throwable thr,
                   AbstractLogger.Level level)
Specified by:
log in class AbstractLogger

logArgs

protected void logArgs(java.lang.String message,
                       java.lang.Object args,
                       AbstractLogger.Level level)
Specified by:
logArgs in class AbstractLogger

getLogLevel

protected static org.apache.logging.log4j.Level getLogLevel(AbstractLogger.Level logLevel)

getLogLevel

protected static org.apache.logging.log4j.Level getLogLevel(LmsLogLevel lmsLogLevel)

getLmsLogLevel

protected static LogLevel getLmsLogLevel(LmsLogLevel lmsLevel)

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.