Platform SDK Java 8.5 API Reference

Package com.genesyslab.platform.commons.log

This package provides logging support for your applications.

See:
          Description

Interface Summary
ILogEnabled Deprecated.  
ILogger This is a facade for the Platform SDK Commons logging subsystem.
It offers a simplified interface that follows the inversion of control pattern and a simplified priority/level/severity abstraction.
Quick examples:
ILoggerFactory Platform SDK Commons Logger Factory interface.
 

Class Summary
AbstractLogEnabled Deprecated.  
AbstractLogger Base class for loggers
AbstractLogger.Level  
GlobalLogger Deprecated.  
JavaUtilLoggerFactoryImpl Platform SDK Commons Logger Factory implementation to send PSDK internal logs to the Java built-in logging system (LogManager).
JavaUtilLoggerImpl Platform SDK Commons Logger implementation which sends PSDK internal logs to the Java built-in logging system (Logger).
Log Platform SDK Commons Logging system facade.
Log4J2Checker Checks availability of Log4j v2.x logging framework in the classpath.
Log4J2LoggerFactoryImpl Platform SDK Commons Logger Factory implementation to send PSDK internal logs to Log4j v2 logging system (LogManager).
Log4J2LoggerImpl Platform SDK Commons Logger implementation which sends PSDK internal logs to Log4j v2 logging system.
Log4JChecker Checks availability of Log4j v1.x logging framework in the classpath.
Log4JLoggerFactoryImpl Platform SDK Commons Logger Factory implementation to send PSDK internal logs to Log4j v1.x logging system (LogManager).
Log4JLoggerImpl Platform SDK Commons Logger implementation which sends PSDK internal logs to Log4j v1.x logging system.
NullLoggerFactoryImpl Silent Platform SDK Commons Logging implementation.
NullLoggerImpl This class is useful for situations where you need to provide a logger to a utility class, but do not want any output from it.
SimpleLoggerFactoryImpl Built-in implementation of Platform SDK Commons Logger Factory to send log events to System.out.
It may be initialized with log level parameter of messages to be passed for printing.
SimpleLoggerImpl Simple implementation of Platform SDK Common Logging interface.
Slf4JChecker Checks availability of Slf4j logging framework in the classpath.
Slf4JLoggerFactoryImpl Platform SDK Commons Logging to Slf4J logger factory adaptor.
It allows to direct PSDK Commons Logging based components' and Platform SDK internal logs to be sent to SLF4J interface.
Slf4JLoggerImpl Platform SDK Commons Logger implementation which sends PSDK internal logs to Slf4j logging interface.
 

Package com.genesyslab.platform.commons.log Description

This package provides logging support for your applications.

To turn on internal logging in the Platform SDK, you have to set up a logger implementation in the Log class BEFORE making any other calls to the Platform SDK. There are two ways to do this:

Starting from Platform SDK version 8.5.1 there are several built-in implementations of the PSDK Commons Logging interface beside previously existing Log4j (version 1.2). There are adaptors for java.util.logging, Slf4j, Log4j 2.x, and simple console output logger.
When particular logging framework adaptor is enabled, all the logging configuration like logging levels, log files management, other logging targets, etc are to be configured in the selected framework.
For example, in case of usage of Log4j v1.2 (with old adaptor com.genesyslab.platform.commons.log.Log4JLoggerFactoryImpl), you will need to configure log4j according to your logging needs. A simple log4j configuration file follows:


log4j.logger.com.genesyslab.platform=DEBUG, A1
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.file=psdk.log
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %-25.25c %x - %m%n

To use more powerful Log4j v2.x framework, it is possible to setup correspondent adaptor - com.genesyslab.platform.commons.log.Log4J2LoggerFactoryImpl (alias name "log4j2") with:

Sample Log4j 2 configuration file (log4j2.xml) may look like:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn">
  <Appenders>
    <File name="MyFile" fileName="logs/psdk.log">
      <PatternLayout>
        <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
      </PatternLayout>
    </File>
    <Async name="Async">
      <AppenderRef ref="MyFile"/>
    </Async>
  </Appenders>
  <Loggers>
    <Root level="error">
      <AppenderRef ref="Async"/>
    </Root>
  </Loggers>
</Configuration>

For general information on the structure and usage of the Platform SDKs, please refer to the introductory pages at the beginning of this guide.


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.