Class StatusConfiguration
java.lang.Object
org.apache.logging.log4j.core.config.status.StatusConfiguration
Configuration for setting up
StatusConsoleListener
instances.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Specifies how verbose the StatusLogger should be. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Level
private static final PrintStream
private static final StatusConfiguration.Verbosity
private PrintStream
private final Collection<String>
private boolean
private final StatusLogger
private Level
private String[]
private StatusConfiguration.Verbosity
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
void
Logs an error message to the StatusLogger.void
Configures and initializes the StatusLogger using the configured options in this instance.private void
private PrintStream
parseStreamName
(String name) private void
withDestination
(String destination) Specifies the destination for StatusLogger events.withStatus
(String status) Specifies the logging level by name to use for filtering StatusLogger messages.withStatus
(Level status) Specifies the logging level to use for filtering StatusLogger messages.withVerboseClasses
(String... verboseClasses) Specifies which class names to filter if the configured verbosity level is QUIET.withVerbosity
(String verbosity) Specifies the verbosity level to log at.
-
Field Details
-
DEFAULT_STREAM
-
DEFAULT_STATUS
-
DEFAULT_VERBOSITY
-
errorMessages
-
logger
-
initialized
private volatile boolean initialized -
destination
-
status
-
verbosity
-
verboseClasses
-
-
Constructor Details
-
StatusConfiguration
public StatusConfiguration()
-
-
Method Details
-
error
Logs an error message to the StatusLogger. If the StatusLogger hasn't been set up yet, queues the message to be logged after initialization.- Parameters:
message
- error message to log.
-
withDestination
Specifies the destination for StatusLogger events. This can beout
(default) for usingstandard out
,err
for usingstandard error
, or a file URI to which log events will be written. If the provided URI is invalid, then the default destination of standard out will be used.- Parameters:
destination
- where status log messages should be output.- Returns:
this
-
parseStreamName
-
withStatus
Specifies the logging level by name to use for filtering StatusLogger messages.- Parameters:
status
- name of logger level to filter below.- Returns:
this
- See Also:
-
withStatus
Specifies the logging level to use for filtering StatusLogger messages.- Parameters:
status
- logger level to filter below.- Returns:
this
-
withVerbosity
Specifies the verbosity level to log at. This only applies to classes configured byverboseClasses
.- Parameters:
verbosity
- basic filter for status logger messages.- Returns:
this
-
withVerboseClasses
Specifies which class names to filter if the configured verbosity level is QUIET.- Parameters:
verboseClasses
- names of classes to filter if not using VERBOSE.- Returns:
this
-
initialize
public void initialize()Configures and initializes the StatusLogger using the configured options in this instance. -
configureExistingStatusConsoleListener
private boolean configureExistingStatusConsoleListener() -
registerNewStatusConsoleListener
private void registerNewStatusConsoleListener() -
migrateSavedLogMessages
private void migrateSavedLogMessages()
-