public interface RuntimeLogger extends MessageLogger<LogPriority>, LogPriorityAccessor, NameAccessor
RuntimeLogger
defines a plain simple
interface for logging out runtime information generated by software systems.
The RuntimeLoggerImpl
implementation takes
care of logging out the class and the method generating a log line.
The RuntimeLoggerImpl
actually takes a
Logger
instance; which implementation to take is
up to you:
(you find the various Logger
implementations in
the refcodes-logger-alt artifact's modules)
Use the factory (the factory is implemented as a singleton)
RuntimeLoggerFactorySingleton
retrieving RuntimeLogger
instances configured by
a "runtimelogger-config.xml" file (using apache configurations notation).
A SLF4J binding exists in the refcodes-logger-ext-slf4j" artifact which binds the refcodes-logger framework to SLF4J enabling to log all your SLF4J logs out by the refcodes-logger framework, e.g. to a SimpleDbLoggerImpl.
The RuntimeLogger
may also be configured with one
of the below mentioned loggers.
LogPriorityAccessor.LogPriorityMutator, LogPriorityAccessor.LogPriorityProperty
NameAccessor.NameBuilder<B extends NameAccessor.NameBuilder<B>>, NameAccessor.NameMutator, NameAccessor.NameProperty
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 . |
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 . |
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,
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 |
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 . |
log, log
getLogPriority
getName
void log(LogPriority aPriority, String aMessage, Throwable aThrowable)
aPriority
- The level of the message.aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.void log(LogPriority aPriority, String aMessage, Throwable aThrowable, Object... aArguments)
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.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.boolean isLog(LogPriority aPriority)
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.aPriority
- The LogPriority
to test whether the
RuntimeLogger
does log messages of that
LogPriority
.RuntimeLogger
does log messages of that
LogPriority
.void trace(String aMessage)
LogPriority.TRACE
.aMessage
- The message to be logged.void trace(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.boolean isLogTrace()
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.void debug(String aMessage)
LogPriority.DEBUG
.
"Info useful to developers for debugging the application, not useful
during operations."aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
void debug(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
boolean isLogDebug()
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.void info(String aMessage)
LogPriority.INFO
.
"Additional information which might be useful for some stability period."aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
void info(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
boolean isLogInfo()
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.void notice(String aMessage)
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."aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
void notice(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
boolean isLogNotice()
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.void warn(String aMessage)
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."aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
void warn(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
void warn(String aMessage, Throwable aThrowable)
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."aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.http://en.wikipedia.org/wiki/Syslog
void warn(String aMessage, Throwable aThrowable, Object... aArguments)
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.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
boolean isLogWarn()
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.void error(String aMessage)
LogPriority.ERROR
.
"Non-urgent failures, these should be relayed to developers or admins;
each item must be resolved within a given time."aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
void error(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
void error(String aMessage, Throwable aThrowable)
LogPriority.ERROR
.
"Non-urgent failures, these should be relayed to developers or admins;
each item must be resolved within a given time."aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.http://en.wikipedia.org/wiki/Syslog
void error(String aMessage, Throwable aThrowable, Object... aArguments)
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.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
boolean isLogError()
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.void critical(String aMessage)
LogPriority.CRITICAL
.
"Should be corrected immediately, but indicates failure in a secondary
system, an example is a loss of a backup ISP connection."aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
void critical(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
void critical(String aMessage, Throwable aThrowable)
LogPriority.CRITICAL
.
"Should be corrected immediately, but indicates failure in a secondary
system, an example is a loss of a backup ISP connection."aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.http://en.wikipedia.org/wiki/Syslog
void critical(String aMessage, Throwable aThrowable, Object... aArguments)
LogPriority.CRITICAL
.
"Should be corrected immediately, but indicates failure in a secondary
system, an example is a loss of a backup ISP connection."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
boolean isLogCritical()
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.void alert(String aMessage)
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."aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
void alert(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
void alert(String aMessage, Throwable aThrowable)
LogPriority.ALERT
.aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.void alert(String aMessage, Throwable aThrowable, Object... aArguments)
LogPriority.ALERT
.aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.aArguments
- The arguments used when replacing the placeholders.boolean isLogAlert()
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.void panic(String aMessage)
LogPriority.PANIC
.
"A "panic" condition usually affecting multiple apps/servers/sites. At
this level it would usually notify all tech staff on call." (aMessage
- The message to be logged.http://en.wikipedia.org/wiki/Syslog
void panic(String aMessage, Object... aArguments)
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.aMessage
- The message to be logged.aArguments
- The arguments used when replacing the placeholders.http://en.wikipedia.org/wiki/Syslog
void panic(String aMessage, Throwable aThrowable)
LogPriority.PANIC
.
"A "panic" condition usually affecting multiple apps/servers/sites. At
this level it would usually notify all tech staff on call." (aMessage
- The message to be logged.aThrowable
- An exception that the message should contain.http://en.wikipedia.org/wiki/Syslog
void panic(String aMessage, Throwable aThrowable, Object... aArguments)
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.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
boolean isLogPanic()
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.Copyright © 2015. All rights reserved.