public class MarkedLogger extends org.slf4j.ext.LoggerWrapper
MarkedLogger is an SLF4J logger with a default marker applied to all methods with a
marker variant.
Example:
final Marker marker = MarkerFactory.getMarker("AUDIT");
final Logger logger = new MarkedLogger(LoggerFactory.getLogger(getClass()), marker);
logger.error("Missing counterparty details on order: {}", order);
logger.error(marker, "Missing counterparty details on order: {}", order);
Marks this logging event as "AUDIT". Suitable logger configuration might redirect this event to
Remedy. Both logging lines are equivalent.
In Logback configuration use %marker to print the marker in the encoder pattern.| Constructor and Description |
|---|
MarkedLogger(org.slf4j.Logger logger,
org.slf4j.Marker marker)
Constructds a new
MarkedLogger for the given parameters. |
MarkedLogger(org.slf4j.Logger logger,
String fqcn,
org.slf4j.Marker marker)
Constructds a new
MarkedLogger for the given parameters suitable as a base class. |
| Modifier and Type | Method and Description |
|---|---|
void |
debug(String msg) |
void |
debug(String format,
Object... args) |
void |
debug(String format,
Object arg) |
void |
debug(String format,
Object arg1,
Object arg2) |
void |
debug(String msg,
Throwable t) |
void |
error(String msg) |
void |
error(String format,
Object... args) |
void |
error(String format,
Object arg) |
void |
error(String format,
Object arg1,
Object arg2) |
void |
error(String msg,
Throwable t) |
org.slf4j.Logger |
getUnderlying()
Gets the underlying wrapped logger for extensions.
|
void |
info(String msg) |
void |
info(String format,
Object... args) |
void |
info(String format,
Object arg) |
void |
info(String format,
Object arg1,
Object arg2) |
void |
info(String msg,
Throwable t) |
void |
trace(String msg) |
void |
trace(String format,
Object... args) |
void |
trace(String format,
Object arg) |
void |
trace(String format,
Object arg1,
Object arg2) |
void |
trace(String msg,
Throwable t) |
void |
warn(String msg) |
void |
warn(String format,
Object... args) |
void |
warn(String format,
Object arg) |
void |
warn(String format,
Object arg1,
Object arg2) |
void |
warn(String msg,
Throwable t) |
debug, debug, debug, debug, debug, error, error, error, error, error, getName, info, info, info, info, info, isDebugEnabled, isDebugEnabled, isErrorEnabled, isErrorEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, trace, trace, trace, trace, trace, warn, warn, warn, warn, warnpublic MarkedLogger(@Nonnull org.slf4j.Logger logger, @Nonnull org.slf4j.Marker marker)
MarkedLogger for the given parameters.logger - the logger to delegate to, never missingmarker - the marker for unmarked logging, never missingpublic MarkedLogger(@Nonnull org.slf4j.Logger logger, @Nonnull String fqcn, @Nonnull org.slf4j.Marker marker)
MarkedLogger for the given parameters suitable as a base class.logger - the logger to delegate to, never missingfqcn - the fully-qualified class name of the extending logger, never missingmarker - the marker for unmarked logging, never missing@Nonnull public final org.slf4j.Logger getUnderlying()
public void trace(String msg)
trace in interface org.slf4j.Loggertrace in class org.slf4j.ext.LoggerWrapperpublic void trace(String format, Object arg)
trace in interface org.slf4j.Loggertrace in class org.slf4j.ext.LoggerWrapperpublic void trace(String format, Object arg1, Object arg2)
trace in interface org.slf4j.Loggertrace in class org.slf4j.ext.LoggerWrapperpublic void trace(String format, Object... args)
trace in interface org.slf4j.Loggertrace in class org.slf4j.ext.LoggerWrapperpublic void trace(String msg, Throwable t)
trace in interface org.slf4j.Loggertrace in class org.slf4j.ext.LoggerWrapperpublic void debug(String msg)
debug in interface org.slf4j.Loggerdebug in class org.slf4j.ext.LoggerWrapperpublic void debug(String format, Object arg)
debug in interface org.slf4j.Loggerdebug in class org.slf4j.ext.LoggerWrapperpublic void debug(String format, Object arg1, Object arg2)
debug in interface org.slf4j.Loggerdebug in class org.slf4j.ext.LoggerWrapperpublic void debug(String format, Object... args)
debug in interface org.slf4j.Loggerdebug in class org.slf4j.ext.LoggerWrapperpublic void debug(String msg, Throwable t)
debug in interface org.slf4j.Loggerdebug in class org.slf4j.ext.LoggerWrapperpublic void info(String msg)
info in interface org.slf4j.Loggerinfo in class org.slf4j.ext.LoggerWrapperpublic void info(String format, Object arg)
info in interface org.slf4j.Loggerinfo in class org.slf4j.ext.LoggerWrapperpublic void info(String format, Object arg1, Object arg2)
info in interface org.slf4j.Loggerinfo in class org.slf4j.ext.LoggerWrapperpublic void info(String format, Object... args)
info in interface org.slf4j.Loggerinfo in class org.slf4j.ext.LoggerWrapperpublic void info(String msg, Throwable t)
info in interface org.slf4j.Loggerinfo in class org.slf4j.ext.LoggerWrapperpublic void warn(String msg)
warn in interface org.slf4j.Loggerwarn in class org.slf4j.ext.LoggerWrapperpublic void warn(String format, Object arg)
warn in interface org.slf4j.Loggerwarn in class org.slf4j.ext.LoggerWrapperpublic void warn(String format, Object arg1, Object arg2)
warn in interface org.slf4j.Loggerwarn in class org.slf4j.ext.LoggerWrapperpublic void warn(String format, Object... args)
warn in interface org.slf4j.Loggerwarn in class org.slf4j.ext.LoggerWrapperpublic void warn(String msg, Throwable t)
warn in interface org.slf4j.Loggerwarn in class org.slf4j.ext.LoggerWrapperpublic void error(String msg)
error in interface org.slf4j.Loggererror in class org.slf4j.ext.LoggerWrapperpublic void error(String format, Object arg)
error in interface org.slf4j.Loggererror in class org.slf4j.ext.LoggerWrapperpublic void error(String format, Object arg1, Object arg2)
error in interface org.slf4j.Loggererror in class org.slf4j.ext.LoggerWrapperpublic void error(String format, Object... args)
error in interface org.slf4j.Loggererror in class org.slf4j.ext.LoggerWrapperCopyright © 2013–2015 binkley's BLOG. All rights reserved.