public class RuntimeLoggerImpl extends Object implements RuntimeLogger, LoggerAccessor.LoggerMutator<Logger<Object>>, org.refcodes.mixin.NameAccessor.NameMutator, LogPriorityAccessor.LogPriorityMutator
RuntimeLogger
interface to be
configured with a (back-end) Logger
. In case no (back-end)
Logger
has been set via setLogger(Logger)
then the plain
SystemLoggerImpl
will be used as fallback.LogPriorityAccessor.LogPriorityMutator, LogPriorityAccessor.LogPriorityProperty
Modifier and Type | Field and Description |
---|---|
static LogPriority |
DEFAULT_LOG_PRIORITY |
static String |
ROOT_LOGGER_NAME |
Constructor and Description |
---|
RuntimeLoggerImpl()
Constructs a
RuntimeLogger logging with the given Logger
and the desired LogPriority for the messages being logged and
upwards (from the given LogPriority.getPriority() and higher). |
RuntimeLoggerImpl(Logger<Object> aLogger)
Constructs a
RuntimeLogger logging with the given Logger
and the desired LogPriority for the messages being logged and
upwards (from the given LogPriority.getPriority() and higher). |
RuntimeLoggerImpl(Logger<Object> aLogger,
LogPriority aPriority)
Constructs a
RuntimeLogger logging with the given Logger
and the desired LogPriority for the messages being logged and
upwards (from the given LogPriority.getPriority() and higher). |
RuntimeLoggerImpl(String aName,
Logger<Object> aLogger)
Constructs a
RuntimeLogger logging with the given Logger
and the desired LogPriority for the messages being logged and
upwards (from the given LogPriority.getPriority() and higher). |
RuntimeLoggerImpl(String aName,
Logger<Object> aLogger,
LogPriority aPriority)
Constructs a
RuntimeLogger logging with the given Logger
and the desired LogPriority for the messages being logged and
upwards (from the given LogPriority.getPriority() and higher). |
Modifier and Type | Method and Description |
---|---|
void |
alert(String aMessage)
Logs a log message with log priority
LogPriority.ALERT . |
void |
alert(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.ALERT . |
void |
alert(String aMessage,
Throwable aThrowable)
Logs a log message with log priority
LogPriority.ALERT . |
void |
alert(String aMessage,
Throwable aThrowable,
Object... aArguments)
Logs a log message with log priority
LogPriority.ALERT . |
void |
critical(String aMessage)
Logs a log message with log priority
LogPriority.CRITICAL . |
void |
critical(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.CRITICAL . |
void |
critical(String aMessage,
Throwable aThrowable)
Logs a log message with log priority
LogPriority.CRITICAL . |
void |
critical(String aMessage,
Throwable aThrowable,
Object... aArguments)
Logs a log message with log priority
LogPriority.CRITICAL . |
void |
debug(String aMessage)
Logs a log message with log priority
LogPriority.DEBUG . |
void |
debug(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.DEBUG . |
protected void |
doLog(LogPriority aLogPriority,
String aMessage,
StackTraceElement aStackTraceElement,
Throwable aThrowable)
Helper method to log the required information.
|
void |
error(String aMessage)
Logs a log message with log priority
LogPriority.ERROR . |
void |
error(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.ERROR . |
void |
error(String aMessage,
Throwable aThrowable)
Logs a log message with log priority
LogPriority.ERROR . |
void |
error(String aMessage,
Throwable aThrowable,
Object... aArguments)
Logs a log message with log priority
LogPriority.ERROR . |
static StackTraceElement |
getCallerStackTraceElement()
Returns the stack trace element belonging to the caller of the caller of
this method.
|
LogPriority |
getLogPriority()
Retrieves the
LogPriority from the LogPriorityAccessor . |
String |
getName() |
void |
info(String aMessage)
Logs a log message with log priority
LogPriority.INFO . |
void |
info(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.INFO . |
boolean |
isLog(LogPriority aPriority)
Determines whether the
RuntimeLogger is being configured to log
messages of the according LogPriority . |
boolean |
isLogAlert()
Determines whether the
RuntimeLogger is being configured to log
fatal messages (LogPriority.ALERT ). |
boolean |
isLogCritical()
Determines whether the
RuntimeLogger is being configured to log
fatal messages (LogPriority.CRITICAL ). |
boolean |
isLogDebug()
Determines whether the
RuntimeLogger is being configured to log
debug messages (LogPriority.DEBUG ). |
boolean |
isLogError()
Determines whether the
RuntimeLogger is being configured to log
errors (LogPriority.ERROR ). |
boolean |
isLogInfo()
Determines whether the
RuntimeLogger is being configured to log
infos (LogPriority.INFO ). |
boolean |
isLogNotice()
Determines whether the
RuntimeLogger is being configured to log
notices (LogPriority.NOTICE ). |
boolean |
isLogPanic()
Determines whether the
RuntimeLogger is being configured to log
fatal messages (LogPriority.PANIC ). |
boolean |
isLogTrace()
Determines whether the
RuntimeLogger is being configured to log
comments (LogPriority.TRACE ). |
boolean |
isLogWarn()
Determines whether the
RuntimeLogger is being configured to log
warnings (LogPriority.WARN ). |
void |
log(LogPriority aPriority,
String aMessage)
Creates a new log message.
|
void |
log(LogPriority aPriority,
String aMessage,
Object... aArguments)
Creates a new log message.
|
void |
log(LogPriority aPriority,
String aMessage,
Throwable aThrowable)
Creates a new log message.
|
void |
log(LogPriority aPriority,
String aMessage,
Throwable aThrowable,
Object... aArguments)
Creates a new log message.
|
void |
notice(String aMessage)
Logs a log message with log priority
LogPriority.NOTICE . |
void |
notice(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.NOTICE . |
void |
panic(String aMessage)
Logs a log message with log priority
LogPriority.PANIC . |
void |
panic(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.PANIC . |
void |
panic(String aMessage,
Throwable aThrowable)
Logs a log message with log priority
LogPriority.PANIC . |
void |
panic(String aMessage,
Throwable aThrowable,
Object... aArguments)
Logs a log message with log priority
LogPriority.PANIC . |
void |
setLogger(Logger<Object> aLogger)
Sets the logger for the logger property.
|
void |
setLogPriority(LogPriority aLogPriority)
Sets the
LogPriority for the LogPriorityAccessor . |
void |
setLogPriorityName(String aLogPriority)
Similar to
setLogPriority(LogPriority) with the difference, that
a String is passed instead of a LogPriority element. |
void |
setName(String aName) |
void |
trace(String aMessage)
Logs a log message with log priority
LogPriority.TRACE . |
void |
trace(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.TRACE . |
void |
warn(String aMessage)
Logs a log message with log priority
LogPriority.WARN . |
void |
warn(String aMessage,
Object... aArguments)
Logs a log message with log priority
LogPriority.WARN . |
void |
warn(String aMessage,
Throwable aThrowable)
Logs a log message with log priority
LogPriority.WARN . |
void |
warn(String aMessage,
Throwable aThrowable,
Object... aArguments)
Logs a log message with log priority
LogPriority.WARN . |
public static final String ROOT_LOGGER_NAME
public static final LogPriority DEFAULT_LOG_PRIORITY
public RuntimeLoggerImpl(String aName, Logger<Object> aLogger, LogPriority aPriority)
RuntimeLogger
logging with the given Logger
and the desired LogPriority
for the messages being logged and
upwards (from the given LogPriority.getPriority()
and higher).aLogger
- The logger used for logging the runtime logs.aPriority
- The LogPriority
specifying which log messages
are to be logged. Any log message with a LogPriority
as
the given one or higher (regarding the
LogPriority.getPriority()
value) is being logged.public RuntimeLoggerImpl(String aName, Logger<Object> aLogger)
RuntimeLogger
logging with the given Logger
and the desired LogPriority
for the messages being logged and
upwards (from the given LogPriority.getPriority()
and higher).aLogger
- The logger used for logging the runtime logs.aPriority
- The LogPriority
specifying which log messages
are to be logged. Any log message with a LogPriority
as
the given one or higher (regarding the
LogPriority.getPriority()
value) is being logged.public RuntimeLoggerImpl(Logger<Object> aLogger, LogPriority aPriority)
RuntimeLogger
logging with the given Logger
and the desired LogPriority
for the messages being logged and
upwards (from the given LogPriority.getPriority()
and higher).aLogger
- The logger used for logging the runtime logs.aPriority
- The LogPriority
specifying which log messages
are to be logged. Any log message with a LogPriority
as
the given one or higher (regarding the
LogPriority.getPriority()
value) is being logged.public RuntimeLoggerImpl(Logger<Object> aLogger)
RuntimeLogger
logging with the given Logger
and the desired LogPriority
for the messages being logged and
upwards (from the given LogPriority.getPriority()
and higher).aLogger
- The logger used for logging the runtime logs.public RuntimeLoggerImpl()
RuntimeLogger
logging with the given Logger
and the desired LogPriority
for the messages being logged and
upwards (from the given LogPriority.getPriority()
and higher).public String getName()
getName
in interface org.refcodes.mixin.NameAccessor
public void log(LogPriority aPriority, String aMessage)
MessageLogger
log
in interface MessageLogger<LogPriority>
aPriority
- The marker for the message.aMessage
- The message to be logged.public void log(LogPriority aPriority, String aMessage, Throwable aThrowable)
RuntimeLogger
log
in interface RuntimeLogger
aPriority
- The level of the message.aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.public boolean isLog(LogPriority aPriority)
RuntimeLogger
RuntimeLogger
is being configured to log
messages of the according LogPriority
.
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLog
in interface RuntimeLogger
aPriority
- The LogPriority
to test whether the
RuntimeLogger
does log messages of that
LogPriority
.RuntimeLogger
does log messages of that
LogPriority
.public LogPriority getLogPriority()
LogPriorityAccessor
LogPriority
from the LogPriorityAccessor
.getLogPriority
in interface LogPriorityAccessor
LogPriority
stored by the LogPriorityAccessor
.public void trace(String aMessage)
RuntimeLogger
LogPriority.TRACE
.trace
in interface RuntimeLogger
aMessage
- The message to be logged.public boolean isLogTrace()
RuntimeLogger
RuntimeLogger
is being configured to log
comments (LogPriority.TRACE
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogTrace
in interface RuntimeLogger
public void debug(String aMessage)
RuntimeLogger
LogPriority.DEBUG
.
"Info useful to developers for debugging the application, not useful
during operations."debug
in interface RuntimeLogger
aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
public boolean isLogDebug()
RuntimeLogger
RuntimeLogger
is being configured to log
debug messages (LogPriority.DEBUG
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogDebug
in interface RuntimeLogger
public void info(String aMessage)
RuntimeLogger
LogPriority.INFO
.
"Additional information which might be useful for some stability period."info
in interface RuntimeLogger
aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
public boolean isLogInfo()
RuntimeLogger
RuntimeLogger
is being configured to log
infos (LogPriority.INFO
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogInfo
in interface RuntimeLogger
public void notice(String aMessage)
RuntimeLogger
LogPriority.NOTICE
.
"Events that are unusual but not error conditions - might be summarized
in an email to developers or admins to spot potential problems - no
immediate action required."notice
in interface RuntimeLogger
aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
public boolean isLogNotice()
RuntimeLogger
RuntimeLogger
is being configured to log
notices (LogPriority.NOTICE
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogNotice
in interface RuntimeLogger
public void warn(String aMessage)
RuntimeLogger
LogPriority.WARN
.
"Warning messages, not an error, but indication that an error will occur
if action is not taken, e.g. file system 85% full - each item must be
resolved within a given time."warn
in interface RuntimeLogger
aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
public void warn(String aMessage, Throwable aThrowable)
RuntimeLogger
LogPriority.WARN
.
"Warning messages, not an error, but indication that an error will occur
if action is not taken, e.g. file system 85% full - each item must be
resolved within a given time."warn
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.http://en.wikipedia.org/wiki/Syslog
public boolean isLogWarn()
RuntimeLogger
RuntimeLogger
is being configured to log
warnings (LogPriority.WARN
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogWarn
in interface RuntimeLogger
public void error(String aMessage)
RuntimeLogger
LogPriority.ERROR
.
"Non-urgent failures, these should be relayed to developers or admins;
each item must be resolved within a given time."error
in interface RuntimeLogger
aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
public void error(String aMessage, Throwable aThrowable)
RuntimeLogger
LogPriority.ERROR
.
"Non-urgent failures, these should be relayed to developers or admins;
each item must be resolved within a given time."error
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.http://en.wikipedia.org/wiki/Syslog
public boolean isLogError()
RuntimeLogger
RuntimeLogger
is being configured to log
errors (LogPriority.ERROR
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogError
in interface RuntimeLogger
public void critical(String aMessage)
RuntimeLogger
LogPriority.CRITICAL
.
"Should be corrected immediately, but indicates failure in a secondary
system, an example is a loss of a backup ISP connection."critical
in interface RuntimeLogger
aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
public void critical(String aMessage, Throwable aThrowable)
RuntimeLogger
LogPriority.CRITICAL
.
"Should be corrected immediately, but indicates failure in a secondary
system, an example is a loss of a backup ISP connection."critical
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.http://en.wikipedia.org/wiki/Syslog
public boolean isLogCritical()
RuntimeLogger
RuntimeLogger
is being configured to log
fatal messages (LogPriority.CRITICAL
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogCritical
in interface RuntimeLogger
public void alert(String aMessage)
RuntimeLogger
LogPriority.ALERT
.
"Should be corrected immediately, therefore notify staff who can fix the
problem. An example would be the loss of a primary ISP connection."alert
in interface RuntimeLogger
aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
public void alert(String aMessage, Throwable aThrowable)
RuntimeLogger
LogPriority.ALERT
.alert
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.public boolean isLogAlert()
RuntimeLogger
RuntimeLogger
is being configured to log
fatal messages (LogPriority.ALERT
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogAlert
in interface RuntimeLogger
public void panic(String aMessage)
RuntimeLogger
LogPriority.PANIC
.
"A "panic" condition usually affecting multiple apps/servers/sites. At
this level it would usually notify all tech staff on call." (panic
in interface RuntimeLogger
aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
public void panic(String aMessage, Throwable aThrowable)
RuntimeLogger
LogPriority.PANIC
.
"A "panic" condition usually affecting multiple apps/servers/sites. At
this level it would usually notify all tech staff on call." (panic
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.http://en.wikipedia.org/wiki/Syslog
public boolean isLogPanic()
RuntimeLogger
RuntimeLogger
is being configured to log
fatal messages (LogPriority.PANIC
).
This method is useful to prevent the generation of vast amounts of log
message String
objects (and according processing) for the
according LogPriority
in case them messages of that
LogPriority
are not logged at all.isLogPanic
in interface RuntimeLogger
public void log(LogPriority aPriority, String aMessage, Object... aArguments)
MessageLogger
String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.log
in interface MessageLogger<LogPriority>
aPriority
- The marker for the message.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.public void log(LogPriority aPriority, String aMessage, Throwable aThrowable, Object... aArguments)
RuntimeLogger
String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.log
in interface RuntimeLogger
aPriority
- The level of the message.aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.aArguments
- The arguments used when replacing the placeholders.public void trace(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.TRACE
.
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.trace
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.public void debug(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.DEBUG
.
"Info useful to developers for debugging the application, not useful
during operations."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.debug
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void info(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.INFO
.
"Additional information which might be useful for some stability period."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.info
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void notice(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.NOTICE
.
"Events that are unusual but not error conditions - might be summarized
in an email to developers or admins to spot potential problems - no
immediate action required."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.notice
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void warn(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.WARN
.
"Warning messages, not an error, but indication that an error will occur
if action is not taken, e.g. file system 85% full - each item must be
resolved within a given time."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.warn
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void warn(String aMessage, Throwable aThrowable, Object... aArguments)
RuntimeLogger
LogPriority.WARN
.
"Warning messages, not an error, but indication that an error will occur
if action is not taken, e.g. file system 85% full - each item must be
resolved within a given time."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.warn
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void error(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.ERROR
.
"Non-urgent failures, these should be relayed to developers or admins;
each item must be resolved within a given time."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.error
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void error(String aMessage, Throwable aThrowable, Object... aArguments)
RuntimeLogger
LogPriority.ERROR
.
"Non-urgent failures, these should be relayed to developers or admins;
each item must be resolved within a given time."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.error
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void critical(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.CRITICAL
.
"Should be corrected immediately, but indicates failure in a secondary
system, an example is a loss of a backup ISP connection."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.critical
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void critical(String aMessage, Throwable aThrowable, Object... aArguments)
RuntimeLogger
LogPriority.CRITICAL
.
"Should be corrected immediately, but indicates failure in a secondary
system, an example is a loss of a backup ISP connection."critical
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void alert(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.ALERT
.
"Should be corrected immediately, therefore notify staff who can fix the
problem. An example would be the loss of a primary ISP connection."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.alert
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void alert(String aMessage, Throwable aThrowable, Object... aArguments)
RuntimeLogger
LogPriority.ALERT
.alert
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.aArguments
- The arguments used when replacing the placeholders.public void panic(String aMessage, Object... aArguments)
RuntimeLogger
LogPriority.PANIC
.
"A "panic" condition usually affecting multiple apps/servers/sites. At
this level it would usually notify all tech staff on call."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.panic
in interface RuntimeLogger
aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void panic(String aMessage, Throwable aThrowable, Object... aArguments)
RuntimeLogger
LogPriority.PANIC
.
"A "panic" condition usually affecting multiple apps/servers/sites. At
this level it would usually notify all tech staff on call."
The placeholders in the message String
are being replaced by the
provided arguments. Implementations of this interface are recommended to
use Java's MessageFormat
's syntax, the placeholder being replaced
by the first argument is identified by "{0}" (without the quotes), the
second one by "{1}", the third one by "{3}" and so on:
Given the message to be "{0} + {1} = {2}" and the three argument be x, y
and x + y, then "{0}" is replaced by the value of x, "{1}" is replaced by
the value of y and "{2}" is replaced by the value of x + y.panic
in interface RuntimeLogger
aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
public void setLogger(Logger<Object> aLogger)
LoggerAccessor.LoggerMutator
setLogger
in interface LoggerAccessor.LoggerMutator<Logger<Object>>
aLogger
- The logger to be stored by the logger property.public void setLogPriorityName(String aLogPriority)
setLogPriority(LogPriority)
with the difference, that
a String
is passed instead of a LogPriority
element. The
String
variant is required by the configuration framework as used
by the RuntimeLoggerSingleton
.aLogPriority
- The String
representation of the required
LogPriority
.public void setLogPriority(LogPriority aLogPriority)
LogPriorityAccessor.LogPriorityMutator
LogPriority
for the LogPriorityAccessor
.setLogPriority
in interface LogPriorityAccessor.LogPriorityMutator
aLogPriority
- The LogPriority
to be stored by the
LogPriorityAccessor
.public void setName(String aName)
setName
in interface org.refcodes.mixin.NameAccessor.NameMutator
protected void doLog(LogPriority aLogPriority, String aMessage, StackTraceElement aStackTraceElement, Throwable aThrowable)
aMessage
- The message to be logged.aStackTraceElement
- The stack trace element to be logged.aThrowable
- The Exception
to be logged.public static StackTraceElement getCallerStackTraceElement()
Copyright © 2016. All rights reserved.