Platform SDK Java 8.5 API Reference

com.genesyslab.platform.commons.log
Class Slf4JLoggerImpl

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

public class Slf4JLoggerImpl
extends java.lang.Object
implements ILogger

Platform SDK Commons Logger implementation which sends PSDK internal logs to Slf4j logging interface.

See Also:
Slf4JLoggerFactoryImpl

Field Summary
static Marker PSDK_FATAL_MESSAGE_MARKER
           
static Marker PSDK_INT_MESSAGE_MARKER
           
static Marker PSDK_MESSAGE_MARKER
           
 
Constructor Summary
Slf4JLoggerImpl(Logger impl)
           
 
Method Summary
 ILogger createChildLogger(java.lang.String name)
          Creates new child logger.
 void debug(java.lang.Object message)
          Logs a message at the DEBUG level.
 void debug(java.lang.Object message, java.lang.Throwable thr)
          Logs a message at the DEBUG level including the stack trace of the Throwable thr passed as parameter.
 void debugFormat(java.lang.String message, java.lang.Object args)
          Logs formatted debug message with optional arguments.
 void error(java.lang.Object message)
          Logs a message at the ERROR level.
 void error(java.lang.Object message, java.lang.Throwable thr)
          Logs a message at the ERROR level including the stack trace of the Throwable thr passed as parameter.
 void errorFormat(java.lang.String message, java.lang.Object args)
          Logs a message at the ERROR level.
To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 void fatalError(java.lang.Object message)
          Logs a message object with the FATAL ERROR level.
 void fatalError(java.lang.Object message, java.lang.Throwable thr)
          Logs a message at the FATAL ERROR level including the stack trace of the Throwable thr passed as parameter.
 void fatalErrorFormat(java.lang.String message, java.lang.Object args)
          Logs a message at the FATAL ERROR level.
To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 void info(java.lang.Object message)
          Logs a message at the INFO level.
 void info(java.lang.Object message, java.lang.Throwable thr)
          Logs a message at the INFO level including the stack trace of the Throwable thr passed as parameter.
 void infoFormat(java.lang.String message, java.lang.Object args)
          Logs a message at the INFO level.
To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 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.
 void warn(java.lang.Object message)
          Logs a message at the WARNING level.
 void warn(java.lang.Object message, java.lang.Throwable thr)
          Logs a message at the WARNING level including the stack trace of the Throwable thr passed as parameter.
 void warnFormat(java.lang.String message, java.lang.Object args)
          Logs a message at the WARNING level.
To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 
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 Marker PSDK_MESSAGE_MARKER

PSDK_INT_MESSAGE_MARKER

public static final Marker PSDK_INT_MESSAGE_MARKER

PSDK_FATAL_MESSAGE_MARKER

public static final Marker PSDK_FATAL_MESSAGE_MARKER
Constructor Detail

Slf4JLoggerImpl

public Slf4JLoggerImpl(Logger impl)
Method Detail

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).

Specified by:
isFatalError in interface ILogger
Returns:
boolean - true if this Logger is enabled for level FATAL ERROR, false otherwise.

fatalError

public void fatalError(java.lang.Object message)
Description copied from interface: ILogger
Logs a message object with 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).

Specified by:
fatalError in interface ILogger
Parameters:
message - the message to log.

fatalError

public void fatalError(java.lang.Object message,
                       java.lang.Throwable thr)
Description copied from interface: ILogger
Logs a message at the FATAL ERROR level including the stack trace of the Throwable thr passed as parameter.

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).

Specified by:
fatalError in interface ILogger
Parameters:
message - the message object to log.
thr - the exception to log, including its stack trace.

fatalErrorFormat

public void fatalErrorFormat(java.lang.String message,
                             java.lang.Object args)
Description copied from interface: ILogger
Logs a message at the FATAL ERROR level.
To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 log.fatalErrorFormat("Value is ''{0}''", new Integer(1));
 log.fatalErrorFormat("Value for index: [{0}] = {1}", new Object[] {ind, val});

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).

Specified by:
fatalErrorFormat in interface ILogger
Parameters:
message - the message to log.
args - parameters to the message.
See Also:
MessageFormat

isError

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

Specified by:
isError in interface ILogger
Returns:
boolean - true if this Logger is enabled for level ERROR, false otherwise.

error

public void error(java.lang.Object message)
Description copied from interface: ILogger
Logs a message at the ERROR level.

Specified by:
error in interface ILogger
Parameters:
message - the message object to log.

error

public void error(java.lang.Object message,
                  java.lang.Throwable thr)
Description copied from interface: ILogger
Logs a message at the ERROR level including the stack trace of the Throwable thr passed as parameter.

Specified by:
error in interface ILogger
Parameters:
message - the message object to log.
thr - the exception to log, including its stack trace.

errorFormat

public void errorFormat(java.lang.String message,
                        java.lang.Object args)
Description copied from interface: ILogger
Logs a message at the ERROR level.
To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 log.errorFormat("Value is ''{0}''", new Integer(1));
 log.errorFormat("Value for index: [{0}] = {1}", new Object[] {ind, val});

Specified by:
errorFormat in interface ILogger
Parameters:
message - the message to log.
args - parameters to the message.
See Also:
MessageFormat

isWarn

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

Specified by:
isWarn in interface ILogger
Returns:
boolean - true if this Logger is enabled for level WARNING, false otherwise.

warn

public void warn(java.lang.Object message)
Description copied from interface: ILogger
Logs a message at the WARNING level.

Specified by:
warn in interface ILogger
Parameters:
message - the message object to log.

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable thr)
Description copied from interface: ILogger
Logs a message at the WARNING level including the stack trace of the Throwable thr passed as parameter.

Specified by:
warn in interface ILogger
Parameters:
message - the message object to log.
thr - the exception to log, including its stack trace.

warnFormat

public void warnFormat(java.lang.String message,
                       java.lang.Object args)
Description copied from interface: ILogger
Logs a message at the WARNING level.
To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 log.warnFormat("Value is ''{0}''", new Integer(1));
 log.warnFormat("Value for index: [{0}] = {1}", new Object[] {ind, val});

Specified by:
warnFormat in interface ILogger
Parameters:
message - the message to log.
args - parameters to the message.
See Also:
MessageFormat

isInfo

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

Specified by:
isInfo in interface ILogger
Returns:
boolean - true if this Logger is enabled for level INFO, false otherwise.

info

public void info(java.lang.Object message)
Description copied from interface: ILogger
Logs a message at the INFO level.

Specified by:
info in interface ILogger
Parameters:
message - the message object to log.

info

public void info(java.lang.Object message,
                 java.lang.Throwable thr)
Description copied from interface: ILogger
Logs a message at the INFO level including the stack trace of the Throwable thr passed as parameter.

Specified by:
info in interface ILogger
Parameters:
message - the message object to log.
thr - the exception to log, including its stack trace.

infoFormat

public void infoFormat(java.lang.String message,
                       java.lang.Object args)
Description copied from interface: ILogger
Logs a message at the INFO level.
To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 log.infoFormat("Value is ''{0}''", new Integer(1));
 log.infoFormat("Value for index: [{0}] = {1}", new Object[] {ind, val});

Specified by:
infoFormat in interface ILogger
Parameters:
message - the message to log.
args - parameters to the message.
See Also:
MessageFormat

isDebug

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

Specified by:
isDebug in interface ILogger
Returns:
boolean - true if this Logger is enabled for level DEBUG, false otherwise.

debug

public void debug(java.lang.Object message)
Description copied from interface: ILogger
Logs a message at the DEBUG level.

Specified by:
debug in interface ILogger
Parameters:
message - the message object to log.

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable thr)
Description copied from interface: ILogger
Logs a message at the DEBUG level including the stack trace of the Throwable thr passed as parameter.

Specified by:
debug in interface ILogger
Parameters:
message - the message object to log.
thr - the exception to log, including its stack trace.

debugFormat

public void debugFormat(java.lang.String message,
                        java.lang.Object args)
Description copied from interface: ILogger
Logs formatted debug message with optional arguments. To format log messages PSDK uses MessageFormat class.
Quick examples on the rules of formatting:
 log.debugFormat("Value is ''{0}''", new Integer(1));
 log.debugFormat("Value for index: [{0}] = {1}", new Object[] {ind, val});

Specified by:
debugFormat in interface ILogger
Parameters:
message - message with format tags
args - arguments for format
See Also:
MessageFormat

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]".

Specified by:
createChildLogger in interface ILogger
Parameters:
name - the child name for the new logger
Returns:
new ILogger instance

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.