Class StatusConfiguration
- java.lang.Object
-
- org.apache.logging.log4j.core.config.status.StatusConfiguration
-
public class StatusConfiguration extends Object
Configuration for setting upStatusConsoleListener
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StatusConfiguration.Verbosity
Specifies how verbose the StatusLogger should be.
-
Constructor Summary
Constructors Constructor Description StatusConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
error(String message)
Logs an error message to the StatusLogger.void
initialize()
Configures and initializes the StatusLogger using the configured options in this instance.StatusConfiguration
withDestination(String destination)
Specifies the destination for StatusLogger events.StatusConfiguration
withStatus(String status)
Specifies the logging level by name to use for filtering StatusLogger messages.StatusConfiguration
withStatus(Level status)
Specifies the logging level to use for filtering StatusLogger messages.StatusConfiguration
withVerboseClasses(String... verboseClasses)
Specifies which class names to filter if the configured verbosity level is QUIET.StatusConfiguration
withVerbosity(String verbosity)
Specifies the verbosity level to log at.
-
-
-
Method Detail
-
error
public void error(String message)
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
public StatusConfiguration withDestination(String destination)
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
-
withStatus
public StatusConfiguration withStatus(String status)
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:
Level
-
withStatus
public StatusConfiguration withStatus(Level status)
Specifies the logging level to use for filtering StatusLogger messages.- Parameters:
status
- logger level to filter below.- Returns:
this
-
withVerbosity
public StatusConfiguration withVerbosity(String verbosity)
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
public StatusConfiguration withVerboseClasses(String... verboseClasses)
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.
-
-