Platform SDK Java 8.5 API Reference

com.genesyslab.platform.commons.log
Class Log4J2LoggerImpl

java.lang.Object
  extended by com.genesyslab.platform.commons.log.AbstractLogger
      extended by com.genesyslab.platform.commons.log.Log4J2LoggerImpl
All Implemented Interfaces:
ILogger

public class Log4J2LoggerImpl
extends AbstractLogger

Platform SDK Commons Logger implementation which sends PSDK internal logs to Log4j v2 logging system.

See Also:
Log4J2LoggerFactoryImpl

Nested Class Summary
 
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.log.AbstractLogger
AbstractLogger.Level
 
Field Summary
protected  org.apache.logging.log4j.Marker marker
           
static org.apache.logging.log4j.Marker PSDK_INT_MESSAGE_MARKER
           
static org.apache.logging.log4j.Marker PSDK_MESSAGE_MARKER
           
 
Constructor Summary
Log4J2LoggerImpl(org.apache.logging.log4j.Logger impl)
           
 
Method Summary
 ILogger createChildLogger(java.lang.String name)
          Creates new child logger.
 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.commons.log.AbstractLogger
debug, debug, debugFormat, error, error, errorFormat, fatalError, fatalError, fatalErrorFormat, formatMessage, info, info, infoFormat, warn, warn, warnFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

marker

protected final org.apache.logging.log4j.Marker marker
Constructor Detail

Log4J2LoggerImpl

public Log4J2LoggerImpl(org.apache.logging.log4j.Logger impl)
Method Detail

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.

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.

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.

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

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

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.