public final class StatusLogger extends AbstractLogger
System.err
.
Normally, the Log4j StatusLogger is configured via the root <Configuration status="LEVEL"/>
node in a Log4j
configuration file. However, this can be overridden via a system property named
"StatusLogger.level" and will work with any Log4j provider.SimpleLogger
,
SimpleLoggerContext
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
DEFAULT_STATUS_LISTENER_LEVEL
System property that can be configured with the
Level name to use as the default level for
StatusListener s. |
static String |
MAX_STATUS_ENTRIES
System property that can be configured with the number of entries in the queue.
|
static String |
STATUS_DATE_FORMAT
System property that can be configured with a date-time format string to use as the format for timestamps
in the status logger output.
|
CATCHING_MARKER, DEFAULT_FLOW_MESSAGE_FACTORY_CLASS, DEFAULT_MESSAGE_FACTORY_CLASS, ENTRY_MARKER, EXCEPTION_MARKER, EXIT_MARKER, FLOW_MARKER, logBuilder, name, THROWING_MARKER
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the list of status events.
|
Level |
getLevel()
Gets the Level associated with the Logger.
|
Iterable<StatusListener> |
getListeners()
Returns a thread safe Iterable for the StatusListener.
|
static StatusLogger |
getLogger()
Retrieve the StatusLogger.
|
List<StatusData> |
getStatusData()
Returns a List of all events as StatusData objects.
|
boolean |
isEnabled(Level level,
Marker marker)
Checks whether this Logger is enabled for the given Level and Marker.
|
boolean |
isEnabled(Level level,
Marker marker,
CharSequence message,
Throwable t)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
Message message,
Throwable t)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
Object message,
Throwable t)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message)
Determine if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object... params)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1,
Object p2)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7,
Object p8)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7,
Object p8,
Object p9)
Determines if logging is enabled.
|
boolean |
isEnabled(Level level,
Marker marker,
String message,
Throwable t)
Determines if logging is enabled.
|
void |
logMessage(String fqcn,
Level level,
Marker marker,
Message msg,
Throwable t)
Adds an event.
|
void |
registerListener(StatusListener listener)
Registers a new listener.
|
void |
removeListener(StatusListener listener)
Removes a StatusListener.
|
void |
reset()
Clears the list of status events and listeners.
|
void |
setLevel(Level level) |
void |
updateListenerLevel(Level status) |
always, atDebug, atError, atFatal, atInfo, atLevel, atTrace, atWarn, catching, catching, catching, catchingMsg, checkMessageFactory, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, enter, enter, enter, enter, enter, entry, entry, entry, entryMsg, entryMsg, entryMsg, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, exit, exit, exit, exit, exitMsg, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, getMessageFactory, getName, getRecursionDepth, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, isDebugEnabled, isDebugEnabled, isEnabled, isErrorEnabled, isErrorEnabled, isFatalEnabled, isFatalEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, printf, printf, requiresLocation, throwing, throwing, throwing, throwingMsg, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, traceEntry, traceEntry, traceEntry, traceEntry, traceEntry, traceExit, traceExit, traceExit, traceExit, traceExit, traceExit, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn
public static final String MAX_STATUS_ENTRIES
public static final String DEFAULT_STATUS_LISTENER_LEVEL
Level
name to use as the default level for
StatusListener
s.public static final String STATUS_DATE_FORMAT
SimpleDateFormat
for supported formats.public static StatusLogger getLogger()
public void registerListener(StatusListener listener)
listener
- The StatusListener to register.public void removeListener(StatusListener listener)
listener
- The StatusListener to remove.public void updateListenerLevel(Level status)
public Iterable<StatusListener> getListeners()
public void reset()
public List<StatusData> getStatusData()
public void clear()
public Level getLevel()
Logger
public void logMessage(String fqcn, Level level, Marker marker, Message msg, Throwable t)
marker
- The Markerfqcn
- The fully qualified class name of the callerlevel
- The logging levelmsg
- The message associated with the event.t
- A Throwable or null.public boolean isEnabled(Level level, Marker marker, String message, Throwable t)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.t
- the exception to log, including its stack trace.public boolean isEnabled(Level level, Marker marker, String message)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.public boolean isEnabled(Level level, Marker marker, String message, Object... params)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.params
- The parameters.public boolean isEnabled(Level level, Marker marker, String message, Object p0)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1, Object p2)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1, Object p2, Object p3)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parametersp8
- the message parameterspublic boolean isEnabled(Level level, Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parametersp8
- the message parametersp9
- the message parameterspublic boolean isEnabled(Level level, Marker marker, CharSequence message, Throwable t)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.t
- A Throwable.public boolean isEnabled(Level level, Marker marker, Object message, Throwable t)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The message.t
- A Throwable.public boolean isEnabled(Level level, Marker marker, Message message, Throwable t)
ExtendedLogger
level
- The logging Level to check.marker
- A Marker or null.message
- The Message.t
- A Throwable.public boolean isEnabled(Level level, Marker marker)
Logger
isEnabled
in interface Logger
isEnabled
in class AbstractLogger
level
- The Level to checkmarker
- The Marker to checktrue
if this Logger is enabled for level and marker, false
otherwise.Copyright © 1999-1969 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.