Platform SDK Java 8.5 API Reference

com.genesyslab.platform.apptemplate.log4j2
Class Log4j2Configurator

java.lang.Object
  extended by com.genesyslab.platform.apptemplate.log4j2.Log4j2Configurator

public class Log4j2Configurator
extends java.lang.Object

This class contains configuration appliance logic for Log4j2 logging framework.


Constructor Summary
Log4j2Configurator()
           
 
Method Summary
static boolean applyLoggingConfig(org.apache.logging.log4j.core.config.Configuration config, IGApplicationConfiguration appConfig, LmsMessageConveyor lmsConveyor)
          Applies Log4j2 logging configuration to the LoggerContext.
static boolean applyLoggingConfig(IGApplicationConfiguration appConfig, LmsMessageConveyor lmsConveyor)
          Parses and applies Log4j2 logging configuration to the LoggerContext.
static org.apache.logging.log4j.spi.LoggerContext getLoggerContext()
          Returns Platform SDK common Log4j2 LoggerContext.
static org.apache.logging.log4j.spi.LoggerContext setConfig(org.apache.logging.log4j.core.config.Configuration config)
          Applies given Log4j2 configuration to Log4j2 Core PSDK LoggerContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4j2Configurator

public Log4j2Configurator()
Method Detail

getLoggerContext

public static org.apache.logging.log4j.spi.LoggerContext getLoggerContext()
Returns Platform SDK common Log4j2 LoggerContext.

Returns:
PSDK common LoggerContext.

applyLoggingConfig

public static boolean applyLoggingConfig(IGApplicationConfiguration appConfig,
                                         LmsMessageConveyor lmsConveyor)
Parses and applies Log4j2 logging configuration to the LoggerContext.

In case of successful configuration appliance this method also resets Platform SDK Commons and LmsEventLogger loggers factories to their PSDK Log4j2 implementations.

Parameters:
appConfig - the application configuration to extract logging configuration from.
lmsConveyor - reference to new LmsMessageConveyor or null to create default one.
Returns:
true if configuration was created and applied, or false if it was not.
Throws:
java.lang.NullPointerException - if given application configuration is null.
See Also:
getLoggerContext(), GApplicationConfiguration

applyLoggingConfig

public static boolean applyLoggingConfig(org.apache.logging.log4j.core.config.Configuration config,
                                         IGApplicationConfiguration appConfig,
                                         LmsMessageConveyor lmsConveyor)
Applies Log4j2 logging configuration to the LoggerContext.

Parameters:
config - the logging configuration to apply.
appConfig - the application configuration.
lmsConveyor - reference to new LmsMessageConveyor or null to create default one.
Returns:
true if configuration successfully applied, or false if it was not.
Throws:
NullPoniterException - if given application configuration is null.
See Also:
getLoggerContext(), GApplicationConfiguration

setConfig

public static org.apache.logging.log4j.spi.LoggerContext setConfig(org.apache.logging.log4j.core.config.Configuration config)
Applies given Log4j2 configuration to Log4j2 Core PSDK LoggerContext.

Parameters:
config - Log4j2 logging configuration description structure.
Returns:
reference to Log4j2 logger context if configuration has been successfully passed to, or null.
See Also:
getLoggerContext(), applyLoggingConfig(IGApplicationConfiguration, LmsMessageConveyor), LoggerContext.start(Configuration)

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.