Platform SDK Java 8.5 API Reference

com.genesyslab.platform.apptemplate.log4j2
Class PsdkLog4j2Configuration

java.lang.Object
  extended by org.apache.logging.log4j.core.AbstractLifeCycle
      extended by org.apache.logging.log4j.core.filter.AbstractFilterable
          extended by org.apache.logging.log4j.core.config.AbstractConfiguration
              extended by org.apache.logging.log4j.core.config.xml.XmlConfiguration
                  extended by com.genesyslab.platform.apptemplate.log4j2.PsdkLog4j2Configuration
All Implemented Interfaces:
java.io.Serializable, org.apache.logging.log4j.core.config.Configuration, org.apache.logging.log4j.core.config.Reconfigurable, org.apache.logging.log4j.core.filter.Filterable, org.apache.logging.log4j.core.LifeCycle

public class PsdkLog4j2Configuration
extends org.apache.logging.log4j.core.config.xml.XmlConfiguration

Log4j2 logging configuration structure implementation with initialization from Genesys CME Application logging settings.

It's designed for usage by Log4j2Configurator.

See Also:
Log4j2Configurator, GApplicationConfiguration, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
org.apache.logging.log4j.core.LifeCycle.State
 
Field Summary
static java.lang.String LOG_EXT_LOGGER_PREFIX
           
static java.lang.String LOG_EXT_SECTION_NAME
           
static java.lang.String PSDK_APPTPL_APPENDER_PREFIX
           
static java.lang.String PSDK_APPTPL_MS_APPENDER_NAME
           
 
Fields inherited from class org.apache.logging.log4j.core.config.AbstractConfiguration
isShutdownHookEnabled, listeners, monitor, pluginManager, pluginPackages, rootNode
 
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
LOGGER
 
Fields inherited from interface org.apache.logging.log4j.core.config.Configuration
CONTEXT_PROPERTIES
 
Constructor Summary
protected PsdkLog4j2Configuration(org.apache.logging.log4j.core.config.ConfigurationSource configSource, IGApplicationConfiguration appConfig, GAppLoggingOptions logOpts)
          Internal configuration structure constructor.
  PsdkLog4j2Configuration(GAppLoggingOptions logOptions)
          The configuration structure constructor.
 
Method Summary
protected  org.apache.logging.log4j.core.config.Node createConsoleAppenderConfigNode(org.apache.logging.log4j.core.config.Node parentNode, TargetDescriptor target)
           
protected  org.apache.logging.log4j.core.config.Node createFileAppenderConfigNode(org.apache.logging.log4j.core.config.Node parentNode, java.lang.String appName, GFileTargetDescriptor target)
           
protected  org.apache.logging.log4j.core.config.Node createGMSAppenderConfigNode(org.apache.logging.log4j.core.config.Node parentNode)
           
protected  org.apache.logging.log4j.core.config.Node createLayoutNode(org.apache.logging.log4j.core.config.Node parentAppender)
           
 IGApplicationConfiguration getAppConfig()
          Returns the source application configuration.
protected
<PluginClass>
org.apache.logging.log4j.core.config.plugins.util.PluginType<PluginClass>
getAppTemplatePlugin(java.lang.String typename, java.lang.Class<PluginClass> pluginClass)
           
 GAppLoggingOptions getLogOptions()
          Returns the source logging configuration options.
protected static java.lang.String logLevelByVerbosity(VerboseLevel level)
           
static PsdkLog4j2Configuration parse(IGApplicationConfiguration appConfig)
          Helper method for making Log4j2 logging configuration by given application configuration.
static PsdkLog4j2Configuration parse(KeyValueCollection logOptions)
          Helper method for making Log4j2 logging configuration by given Genesys "log" section style configuration options.
 org.apache.logging.log4j.core.config.Configuration reconfigure()
           
 void setup()
           
protected  void setupCustomLoggers(GAppLogExtOptions logExtOptions, org.apache.logging.log4j.core.config.Node loggersNode)
           
protected  void setupNewAppenders(java.util.List<TargetDescriptor> targets, VerboseLevel rootLoggerVerbosity, org.apache.logging.log4j.core.config.Node appsNode, java.util.List<org.apache.logging.log4j.core.config.Node> appLoggers)
           
protected  void setupRemoveStartupAppenders(java.util.List<org.apache.logging.log4j.core.config.Node> appLoggers)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.logging.log4j.core.config.AbstractConfiguration
addAppender, addComponent, addListener, addLogger, addLoggerAppender, addLoggerFilter, createAdvertiser, createConfiguration, doConfigure, getAdvertiser, getAppender, getAppenders, getComponent, getConfigurationMonitor, getConfigurationSource, getCustomLevels, getDefaultStatus, getLogger, getLoggerConfig, getLoggers, getName, getPluginPackages, getProperties, getRootLogger, getStrSubstitutor, isShutdownHookEnabled, removeAppender, removeListener, removeLogger, setAdvertiser, setConfigurationMonitor, setLoggerAdditive, setName, start, stop, toByteArray
 
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, hasFilter, isFiltered, removeFilter
 
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, hashCodeImpl, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.logging.log4j.core.filter.Filterable
addFilter, getFilter, hasFilter, isFiltered, removeFilter
 
Methods inherited from interface org.apache.logging.log4j.core.LifeCycle
getState, isStarted, isStopped
 

Field Detail

PSDK_APPTPL_APPENDER_PREFIX

public static final java.lang.String PSDK_APPTPL_APPENDER_PREFIX
See Also:
Constant Field Values

PSDK_APPTPL_MS_APPENDER_NAME

public static final java.lang.String PSDK_APPTPL_MS_APPENDER_NAME
See Also:
Constant Field Values

LOG_EXT_SECTION_NAME

public static final java.lang.String LOG_EXT_SECTION_NAME
See Also:
Constant Field Values

LOG_EXT_LOGGER_PREFIX

public static final java.lang.String LOG_EXT_LOGGER_PREFIX
See Also:
Constant Field Values
Constructor Detail

PsdkLog4j2Configuration

protected PsdkLog4j2Configuration(org.apache.logging.log4j.core.config.ConfigurationSource configSource,
                                  IGApplicationConfiguration appConfig,
                                  GAppLoggingOptions logOpts)
Internal configuration structure constructor.

Parameters:
configSource - the configuration profile source; may be #NULL_CONFIG_SOURCE if no configuration profile used.
appConfig - the application configuration source.
logOpts - the application logging options initialized from the "log" section.
See Also:
parse(IGApplicationConfiguration), parse(KeyValueCollection)

PsdkLog4j2Configuration

public PsdkLog4j2Configuration(GAppLoggingOptions logOptions)
The configuration structure constructor.

Parameters:
logOptions - the application logging options.
Throws:
java.lang.NullPointerException - if given logOptions value is null.
Method Detail

getAppConfig

public IGApplicationConfiguration getAppConfig()
Returns the source application configuration. It may be null if this instance was created by logging options without application configuration providing.

Returns:
the application configuration or null.

getLogOptions

public GAppLoggingOptions getLogOptions()
Returns the source logging configuration options.

Returns:
the logging configuration options.

parse

public static PsdkLog4j2Configuration parse(KeyValueCollection logOptions)
Helper method for making Log4j2 logging configuration by given Genesys "log" section style configuration options.

Parameters:
logOptions - the source logging configuration options.
Returns:
Log4j2 configuration structure.
Throws:
java.lang.NullPointerException - if given logOptions value is null.

parse

public static PsdkLog4j2Configuration parse(IGApplicationConfiguration appConfig)
Helper method for making Log4j2 logging configuration by given application configuration.

Parameters:
appConfig - the source application configuration.
Returns:
Log4j2 configuration structure.
Throws:
java.lang.NullPointerException - if given appConfig value is null.

setup

public void setup()
Overrides:
setup in class org.apache.logging.log4j.core.config.xml.XmlConfiguration

setupRemoveStartupAppenders

protected void setupRemoveStartupAppenders(java.util.List<org.apache.logging.log4j.core.config.Node> appLoggers)

setupCustomLoggers

protected void setupCustomLoggers(GAppLogExtOptions logExtOptions,
                                  org.apache.logging.log4j.core.config.Node loggersNode)

setupNewAppenders

protected void setupNewAppenders(java.util.List<TargetDescriptor> targets,
                                 VerboseLevel rootLoggerVerbosity,
                                 org.apache.logging.log4j.core.config.Node appsNode,
                                 java.util.List<org.apache.logging.log4j.core.config.Node> appLoggers)

reconfigure

public org.apache.logging.log4j.core.config.Configuration reconfigure()
Specified by:
reconfigure in interface org.apache.logging.log4j.core.config.Reconfigurable
Overrides:
reconfigure in class org.apache.logging.log4j.core.config.xml.XmlConfiguration

getAppTemplatePlugin

protected <PluginClass> org.apache.logging.log4j.core.config.plugins.util.PluginType<PluginClass> getAppTemplatePlugin(java.lang.String typename,
                                                                                                                       java.lang.Class<PluginClass> pluginClass)

createConsoleAppenderConfigNode

protected org.apache.logging.log4j.core.config.Node createConsoleAppenderConfigNode(org.apache.logging.log4j.core.config.Node parentNode,
                                                                                    TargetDescriptor target)

createFileAppenderConfigNode

protected org.apache.logging.log4j.core.config.Node createFileAppenderConfigNode(org.apache.logging.log4j.core.config.Node parentNode,
                                                                                 java.lang.String appName,
                                                                                 GFileTargetDescriptor target)

createGMSAppenderConfigNode

protected org.apache.logging.log4j.core.config.Node createGMSAppenderConfigNode(org.apache.logging.log4j.core.config.Node parentNode)

createLayoutNode

protected org.apache.logging.log4j.core.config.Node createLayoutNode(org.apache.logging.log4j.core.config.Node parentAppender)

logLevelByVerbosity

protected static java.lang.String logLevelByVerbosity(VerboseLevel level)

toString

public java.lang.String toString()
Overrides:
toString in class org.apache.logging.log4j.core.config.xml.XmlConfiguration

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.