|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.apptemplate.configuration.log.GAppLogExtOptions
public class GAppLogExtOptions
Parser of "log-extended" section of CME Application objects' Options.
This class is automatically used byApplication Configuration Manager
and
Log4j2 Configurator
.
For a case, when application does not use the configuration manager, does need some custom logging configuration,
or for some testing purposes, it is possible to use this class to create logging configuration.
CfgApplication theApp = confService.retrieveObject(
CfgApplication.class, new CfgApplicationQuery(myAppName));
GApplicationConfiguration appConfig = new GCOMApplicationConfiguration(theApp);
GAppLoggingOptions logOpts = new GAppLoggingOptions(appConfig, null);
GAppLogExtOptions logExtOpts = logOpts.getLogExtendedOptions();
Or simple initialization without application configuration reading (without ConfService usage):
KeyValueCollection logSection = new KeyValueCollection();
logSection.addString("verbose", "all");
logSection.addString("message-format", "full");
logSection.addString("standard", "Log4j2ConfiguratorTest-std");
logSection.addString("all", "stdout, Log4j2ConfiguratorTest-all");
KeyValueCollection logExtSection = new KeyValueCollection();
logExtSection.addString("level-reassign-14005", "ALARM");
logExtSection.addString("level-reassign-14006", "ALARM");
logExtSection.addString("logger-psdk", "com.genesyslab.platform: level=debug");
logExtSection.addString("logger-apache", "org.apache: level=error, additivity=false, includeLocation=false");
GAppLoggingOptions logOpts = new GAppLoggingOptions(logSection, logExtSection, null);
GAppLogExtOptions logExtOpts = logOpts.getLogExtendedOptions();
Field Summary | |
---|---|
static java.lang.String |
LEVEL_REASSIGN_DISABLE_EXT_OPT
|
static java.lang.String |
LEVEL_REASSIGN_OPT_PREFIX
|
static java.lang.String |
LOG_EXT_LOGGER_PREFIX
|
Constructor Summary | |
---|---|
GAppLogExtOptions(KeyValueCollection logExtOptions,
ILogger logger)
Parsing constructor of "log-extended" section of application Options.
|
Method Summary | |
---|---|
GAppLogExtOptions |
clone()
|
java.util.Map<java.lang.String,CustomLoggerExtConfig> |
getCustomLoggers()
Returns loggers customization options. It represents extended logging options like following: |
java.util.Map<java.lang.Integer,LmsLogLevel> |
getLevelReassigns()
Returns LMS events levels reassignment configuration. It represents extended logging options like following: |
protected java.util.Map<java.lang.String,CustomLoggerExtConfig> |
parseCustomLoggers(KeyValueCollection optsLogExt)
Parsing method for custom loggers declarations. |
protected java.util.Map<java.lang.Integer,LmsLogLevel> |
parseLevelReassignments(KeyValueCollection optsLogExt)
Extracts map of LMS events level reassignment configuration from "log-extended" section of the application configuration object. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LEVEL_REASSIGN_OPT_PREFIX
public static final java.lang.String LEVEL_REASSIGN_DISABLE_EXT_OPT
public static final java.lang.String LOG_EXT_LOGGER_PREFIX
Constructor Detail |
---|
public GAppLogExtOptions(KeyValueCollection logExtOptions, ILogger logger)
KeyValueCollection logExtSection = new KeyValueCollection();
logExtSection.addString("level-reassign-14005", "ALARM");
logExtSection.addString("level-reassign-14006", "ALARM");
logExtSection.addString("logger-psdk", "com.genesyslab.platform: level=debug");
logExtSection.addString("logger-apache", "org.apache: level=error");
GAppLogExtOptions logExtOpts = new GAppLogExtOptions(logExtSection, null);
logExtOptions
- the application "log-extended" Options section.logger
- optional "status" logger to print errors of options parsing methods.GAppLoggingOptions
Method Detail |
---|
public GAppLogExtOptions clone()
clone
in class java.lang.Object
public java.util.Map<java.lang.Integer,LmsLogLevel> getLevelReassigns()
[log-extended] "level-reassign-14005" = "ALARM" "level-reassign-14006" = "ALARM"This value is
null
if there are no reassignment declarations or reassignment
is disabled with[log-extended] "level-reassign-disabled" = "true"
public java.util.Map<java.lang.String,CustomLoggerExtConfig> getCustomLoggers()
[log-extended] "logger-psdk" = "com.genesyslab.platform: level=debug" "logger-apache" = "org.apache: level=error"This sample represents a map with two elements:
"com.genesyslab.platform" => CustomLoggerExtConfig( ID = "psdk", Name = "com.genesyslab.platform", Property["level"] = "debug" ), "org.apache" => CustomLoggerExtConfig( ID = "apache", Name = "org.apache", Property["level"] = "error" )This value is
null
if there are no loggers configuration declarations.
CustomLoggerExtConfig
protected java.util.Map<java.lang.Integer,LmsLogLevel> parseLevelReassignments(KeyValueCollection optsLogExt)
optsLogExt
- the extended log options of the application.
protected java.util.Map<java.lang.String,CustomLoggerExtConfig> parseCustomLoggers(KeyValueCollection optsLogExt)
optsLogExt
- the extended log options of the application.
CustomLoggerExtConfig
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |