|
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.commons.log.AbstractLogger
com.genesyslab.platform.apptemplate.lmslogger.AbstractLmsEventLogger
public abstract class AbstractLmsEventLogger
Abstract base class with common methods implementation of LmsEventLogger
interface.
LmsLoggerFactory.getLogger(Class)
,
LmsLoggerFactory.getLogger(String)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.log.AbstractLogger |
---|
AbstractLogger.Level |
Field Summary | |
---|---|
protected static java.lang.String |
CTX_ATTRMAP_PREFIX
|
protected static java.lang.String |
CTX_LMSATTR_CATEGORY
|
protected static java.lang.String |
CTX_LMSATTR_ID
|
protected static java.lang.String |
CTX_LMSATTR_LEVEL
|
protected static java.lang.String |
CTX_LMSATTR_NAME
|
protected static java.lang.String |
CTX_LMSATTR_PREFIX
|
protected static LmsMessageTemplate |
DEFAULT_LMS_EVENT
|
protected LmsMessageConveyor |
lmsMessages
|
protected static java.lang.String |
LOG_WRAPPER_FQCN
|
protected boolean |
printAttributes
|
Fields inherited from interface com.genesyslab.platform.apptemplate.lmslogger.LmsEventLogger |
---|
STR_PSDK_LMS_ALARM_MESSAGE_MARKER, STR_PSDK_LMS_MESSAGE_MARKER |
Constructor Summary | |
---|---|
protected |
AbstractLmsEventLogger(LmsMessageConveyor imc)
|
Method Summary | |
---|---|
void |
debug(LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as a debug message. |
void |
debug(LogCategory category,
LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as a debug message. |
void |
debug(java.lang.Object message)
Logs a message at the DEBUG level. |
void |
debug(java.lang.Object message,
java.lang.Throwable e)
Logs a message at the DEBUG level including the stack trace of the Throwable
thr passed as parameter. |
void |
debug(java.lang.String message,
java.lang.Object... args)
Logs formatted debug message with optional arguments. |
protected abstract void |
doLogEvent(LogCategory category,
AbstractLogger.Level logLevel,
LmsMessageTemplate key,
java.lang.Object... args)
Logs a localized message. Specific LmsEventLogger class should implement this method to process log messages. |
void |
error(LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as an error message. |
void |
error(LogCategory category,
LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as an error message. |
void |
error(java.lang.Object message)
Logs a message at the ERROR level. |
void |
error(java.lang.Object message,
java.lang.Throwable e)
Logs a message at the ERROR level including the stack trace of the Throwable
thr passed as parameter. |
void |
error(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 |
fatal(LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as a fatal error message. |
void |
fatal(LogCategory category,
LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as a fatal error message. |
void |
fatal(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 |
fatalError(LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as a fatal error message. |
void |
fatalError(LogCategory category,
LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as a fatal error message. |
void |
fatalError(java.lang.Object message)
Logs a message object with the FATAL ERROR level. |
void |
fatalError(java.lang.Object message,
java.lang.Throwable e)
Logs a message at the FATAL ERROR level including the stack trace of the Throwable
thr passed as parameter. |
protected static java.lang.Throwable |
getThrowableArg(java.lang.Object... args)
Returns the last argument value as Throwable . |
void |
info(LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as an info message. |
void |
info(LogCategory category,
LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as an info message. |
void |
info(java.lang.Object message)
Logs a message at the INFO level. |
void |
info(java.lang.Object message,
java.lang.Throwable e)
Logs a message at the INFO level including the stack trace of the Throwable
thr passed as parameter. |
void |
info(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:
|
void |
log(int key,
java.lang.Object... args)
Logs a localized message. Its usage may look like:
|
void |
log(LmsMessageTemplate key,
java.lang.Object... args)
Logs a localized message. Its usage may look like:
|
void |
log(LogCategory category,
int key,
java.lang.Object... args)
Logs a localized message. Its usage may look like:
|
void |
log(LogCategory category,
LmsMessageTemplate key,
java.lang.Object... args)
Logs a localized message. Its usage may look like:
|
void |
trace(java.lang.String message,
java.lang.Object... args)
Logs formatted trace message with optional arguments. |
void |
warn(LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as a warning message. |
void |
warn(LogCategory category,
LmsMessageTemplate key,
java.lang.Object... args)
Logs localized LMS event as a warning message. |
void |
warn(java.lang.Object message)
Logs a message at the WARNING level. |
void |
warn(java.lang.Object message,
java.lang.Throwable e)
Logs a message at the WARNING level including the stack trace of the Throwable
thr passed as parameter. |
void |
warn(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 com.genesyslab.platform.commons.log.AbstractLogger |
---|
debugFormat, errorFormat, fatalErrorFormat, formatMessage, infoFormat, log, logArgs, warnFormat |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.genesyslab.platform.commons.log.ILogger |
---|
createChildLogger, debugFormat, errorFormat, fatalErrorFormat, infoFormat, isDebug, isError, isFatalError, isInfo, isWarn, warnFormat |
Field Detail |
---|
protected static final java.lang.String CTX_LMSATTR_ID
protected static final java.lang.String CTX_LMSATTR_NAME
protected static final java.lang.String CTX_LMSATTR_LEVEL
protected static final java.lang.String CTX_LMSATTR_CATEGORY
protected static final java.lang.String CTX_LMSATTR_PREFIX
protected static final java.lang.String CTX_ATTRMAP_PREFIX
protected static final java.lang.String LOG_WRAPPER_FQCN
protected static final LmsMessageTemplate DEFAULT_LMS_EVENT
protected final LmsMessageConveyor lmsMessages
protected final boolean printAttributes
Constructor Detail |
---|
protected AbstractLmsEventLogger(LmsMessageConveyor imc)
Method Detail |
---|
public void log(LogCategory category, LmsMessageTemplate key, java.lang.Object... args)
lmsLogger.log(LogCategory.Application, CommonLmsEnum.GCTI_APP_STARTED);
lmsLogger.log(LogCategory.Application, CommonLmsEnum.GCTI_LOAD_RESOURCE, rcName, errCode);
log
in interface LmsEventLogger
category
- the log event category.key
- the key used for localization.args
- optional arguments.public void log(LogCategory category, int key, java.lang.Object... args)
lmsLogger.log(LogCategory.Application, 5060); // CommonLmsEnum.GCTI_APP_STARTED
lmsLogger.log(LogCategory.Application, 2002, rcName, errCode); // CommonLmsEnum.GCTI_LOAD_RESOURCE
log
in interface LmsEventLogger
category
- the log event category.key
- the key used for localization.args
- optional arguments.public void log(LmsMessageTemplate key, java.lang.Object... args)
lmsLogger.log(CommonLmsEnum.GCTI_APP_STARTED);
lmsLogger.log(CommonLmsEnum.GCTI_LOAD_RESOURCE, rcName, errCode);
log
in interface LmsEventLogger
key
- the key used for localization.args
- optional arguments.public void log(int key, java.lang.Object... args)
lmsLogger.log(5060); // CommonLmsEnum.GCTI_APP_STARTED
lmsLogger.log(2002, rcName, errCode); // CommonLmsEnum.GCTI_LOAD_RESOURCE
log
in interface LmsEventLogger
key
- the key used for localization.args
- optional arguments.public void fatalError(java.lang.Object message)
FATAL ERROR
level.
Note: Some of PSDK supported logging frameworks (namely "Slf4J
"
and "java.util.logging
") do not support FATAL ERROR
messages level.Slf4J
logging adapter PSDK marks such messages with "PSDK_FATAL_MESSAGE" marker.java.util.logging
adapter this level is processed as ERROR
(SEVERE
).
fatalError
in interface ILogger
fatalError
in class AbstractLogger
message
- the message to log.public void fatalError(java.lang.Object message, java.lang.Throwable e)
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.Slf4J
logging adapter PSDK marks such messages with "PSDK_FATAL_MESSAGE" marker.java.util.logging
adapter this level is processed as ERROR
(SEVERE
).
fatalError
in interface ILogger
fatalError
in class AbstractLogger
message
- the message object to log.e
- the exception to log, including its stack trace.public void fatalError(LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".fatal(...)
" method call.fatal
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
fatalError
in interface LmsEventLogger
key
- the key used for localization.args
- optional arguments.public void fatalError(LogCategory category, LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".fatal(...)
" method call.fatal
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
fatalError
in interface LmsEventLogger
category
- the log event category.key
- the key used for localization.args
- optional arguments.public void fatal(LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".fatal(...)
" method call.fatal
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
fatal
in interface LmsEventLogger
key
- the key used for localization.args
- optional arguments.public void fatal(LogCategory category, LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".fatal(...)
" method call.fatal
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
fatal
in interface LmsEventLogger
category
- the log event category.key
- the key used for localization.args
- optional arguments.public void fatal(java.lang.String message, java.lang.Object... args)
FATAL ERROR
level.MessageFormat
class.
log.fatal("Value is ''{0}''", 1);
log.fatal("Value for index: [{0}] = {1}", ind, val);
Note: Some of PSDK supported logging frameworks (namely "Slf4J
"
and "java.util.logging
") do not support FATAL ERROR
messages level.Slf4J
logging adapter PSDK marks such messages with "PSDK_FATAL_MESSAGE" marker.java.util.logging
adapter this level is processed as ERROR
(SEVERE
).
fatal
in interface ILoggerEx
message
- the message to log.args
- parameters to the message.MessageFormat
public void error(java.lang.Object message)
ERROR
level.
error
in interface ILogger
error
in class AbstractLogger
message
- the message object to log.public void error(java.lang.Object message, java.lang.Throwable e)
ERROR
level including the stack trace of the Throwable
thr
passed as parameter.
error
in interface ILogger
error
in class AbstractLogger
message
- the message object to log.e
- the exception to log, including its stack trace.public void error(LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".error(...)
" method call.error
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
error
in interface LmsEventLogger
key
- the key used for localization.args
- optional arguments.public void error(LogCategory category, LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".error(...)
" method call.error
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
error
in interface LmsEventLogger
category
- the log event category.key
- the key used for localization.args
- optional arguments.public void error(java.lang.String message, java.lang.Object... args)
ERROR
level.MessageFormat
class.
log.error("Value is ''{0}''", 1);
log.error("Value for index: [{0}] = {1}", ind, val);
error
in interface ILoggerEx
message
- the message to log.args
- parameters to the message.MessageFormat
public void warn(java.lang.Object message)
WARNING
level.
warn
in interface ILogger
warn
in class AbstractLogger
message
- the message object to log.public void warn(java.lang.Object message, java.lang.Throwable e)
WARNING
level including the stack trace of the Throwable
thr
passed as parameter.
warn
in interface ILogger
warn
in class AbstractLogger
message
- the message object to log.e
- the exception to log, including its stack trace.public void warn(LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".warn(...)
" method call.warn
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
warn
in interface LmsEventLogger
key
- the key used for localization.args
- optional arguments.public void warn(LogCategory category, LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".warn(...)
" method call.warn
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
warn
in interface LmsEventLogger
category
- the log event category.key
- the key used for localization.args
- optional arguments.public void warn(java.lang.String message, java.lang.Object... args)
WARNING
level.MessageFormat
class.
log.warn("Value is ''{0}''", 1);
log.warn("Value for index: [{0}] = {1}", ind, val);
warn
in interface ILoggerEx
message
- the message to log.args
- parameters to the message.MessageFormat
public void info(java.lang.Object message)
INFO
level.
info
in interface ILogger
info
in class AbstractLogger
message
- the message object to log.public void info(java.lang.Object message, java.lang.Throwable e)
INFO
level including the stack trace of the Throwable
thr
passed as parameter.
info
in interface ILogger
info
in class AbstractLogger
message
- the message object to log.e
- the exception to log, including its stack trace.public void info(LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".info(...)
" method call.info
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
info
in interface LmsEventLogger
key
- the key used for localization.args
- optional arguments.public void info(LogCategory category, LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".info(...)
" method call.info
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
info
in interface LmsEventLogger
category
- the log event category.key
- the key used for localization.args
- optional arguments.public void info(java.lang.String message, java.lang.Object... args)
INFO
level.MessageFormat
class.
log.info("Value is ''{0}''", 1);
log.info("Value for index: [{0}] = {1}", ind, val);
info
in interface ILoggerEx
message
- the message to log.args
- parameters to the message.MessageFormat
public void debug(java.lang.Object message)
DEBUG
level.
debug
in interface ILogger
debug
in class AbstractLogger
message
- the message object to log.public void debug(java.lang.Object message, java.lang.Throwable e)
DEBUG
level including the stack trace of the Throwable
thr
passed as parameter.
debug
in interface ILogger
debug
in class AbstractLogger
message
- the message object to log.e
- the exception to log, including its stack trace.public void debug(LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".debug(...)
" method call.debug
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
debug
in interface LmsEventLogger
key
- the key used for localization.args
- optional arguments.public void debug(LogCategory category, LmsMessageTemplate key, java.lang.Object... args)
LmsMessageTemplate.getLevel()
) logged with this method.LmsEventLogger
applies LMS localization and pass this call to actual underlying
log system as ".debug(...)
" method call.debug
",
but in case of Message Server appender, or Log4j2
GLmsLayout
,
there will be value of LmsMessageTemplate.getLevel()
.
debug
in interface LmsEventLogger
category
- the log event category.key
- the key used for localization.args
- optional arguments.public void debug(java.lang.String message, java.lang.Object... args)
MessageFormat
class.
log.debug("Value is ''{0}''", 1);
log.debug("Value for index: [{0}] = {1}", ind, val);
debug
in interface ILoggerEx
message
- message with format tagsargs
- arguments for formatMessageFormat
public void trace(java.lang.String message, java.lang.Object... args)
MessageFormat
class.
log.trace("Value is ''{0}''", 1);
log.trace("Value for index: [{0}] = {1}", ind, val);
trace
in interface ILoggerEx
message
- message with format tagsargs
- arguments for formatMessageFormat
protected abstract void doLogEvent(LogCategory category, AbstractLogger.Level logLevel, LmsMessageTemplate key, java.lang.Object... args)
category
- the log event category.logLevel
- the PSDK log level value.key
- the key used for localization.args
- optional arguments.protected static java.lang.Throwable getThrowableArg(java.lang.Object... args)
Throwable
.
args
- arguments of a log request.
Throwable
, or null
.
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |