Class StatusConfiguration
- java.lang.Object
-
- org.apache.logging.log4j.core.config.status.StatusConfiguration
-
public class StatusConfiguration extends java.lang.ObjectConfiguration for setting up theStatusLoggerfallback listener.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStatusConfiguration.VerbosityDeprecated.This class is not used anymore and only kept for binary backward compatibility.
-
Field Summary
Fields Modifier and Type Field Description private booleaninitializedprivate @Nullable Levellevelprivate java.util.concurrent.locks.Locklockprivate static StatusLoggerLOGGERprivate @Nullable java.io.PrintStreamoutput
-
Constructor Summary
Constructors Constructor Description StatusConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiderror(java.lang.String message)Deprecated.UseStatusLogger.getLogger()and thenAbstractLogger.error(String)instead.voidinitialize()Configures and initializes the StatusLogger using the configured options in this instance.private static @Nullable java.io.PrintStreamparseStreamName(@Nullable java.lang.String name)StatusConfigurationwithDestination(@Nullable java.lang.String destination)Sets the output of theStatusLoggerfallback listener.StatusConfigurationwithStatus(@Nullable java.lang.String level)Sets the level of theStatusLoggerfallback listener.StatusConfigurationwithStatus(@Nullable Level level)Sets the level of theStatusLoggerfallback listener.StatusConfigurationwithVerboseClasses(java.lang.String... verboseClasses)Deprecated.This method is ineffective and only kept for binary backward compatibility.StatusConfigurationwithVerbosity(java.lang.String verbosity)Deprecated.This method is ineffective and only kept for binary backward compatibility.
-
-
-
Field Detail
-
LOGGER
private static final StatusLogger LOGGER
-
lock
private final java.util.concurrent.locks.Lock lock
-
initialized
private volatile boolean initialized
-
output
private @Nullable java.io.PrintStream output
-
level
private @Nullable Level level
-
-
Method Detail
-
error
@Deprecated public void error(java.lang.String message)
Deprecated.UseStatusLogger.getLogger()and thenAbstractLogger.error(String)instead.Logs an error message to theStatusLogger.- Parameters:
message- error message to log
-
withDestination
public StatusConfiguration withDestination(@Nullable java.lang.String destination)
Sets the output of theStatusLoggerfallback listener.Accepted values are as follows:
out(i.e.,System.out)err(i.e.,System.err)- a URI (e.g.,
file:///path/to/log4j-status-logs.txt)
Invalid values will be ignored.
- Parameters:
destination- destination whereStatusLoggermessages should be output- Returns:
this
-
parseStreamName
private static @Nullable java.io.PrintStream parseStreamName(@Nullable java.lang.String name) throws java.net.URISyntaxException, java.io.FileNotFoundException- Throws:
java.net.URISyntaxExceptionjava.io.FileNotFoundException
-
withStatus
public StatusConfiguration withStatus(@Nullable java.lang.String level)
Sets the level of theStatusLoggerfallback listener.- Parameters:
level- a level name- Returns:
this
-
withStatus
public StatusConfiguration withStatus(@Nullable Level level)
Sets the level of theStatusLoggerfallback listener.- Parameters:
level- a level- Returns:
this
-
withVerbosity
@Deprecated public StatusConfiguration withVerbosity(java.lang.String verbosity)
Deprecated.This method is ineffective and only kept for binary backward compatibility.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
@Deprecated public StatusConfiguration withVerboseClasses(java.lang.String... verboseClasses)
Deprecated.This method is ineffective and only kept for binary backward compatibility.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.
-
-