Class DefaultLogBuilder
java.lang.Object
org.apache.logging.log4j.internal.DefaultLogBuilder
- All Implemented Interfaces:
BridgeAware
,LogBuilder
Collects data for a log event and then logs it. This class should be considered private.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Message
private String
private static final String
private boolean
private Level
private StackTraceElement
private ExtendedLogger
private static final Logger
private Marker
private long
private Throwable
Fields inherited from interface org.apache.logging.log4j.LogBuilder
NOOP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isEnabled
(CharSequence message) protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
isEnabled
(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) protected boolean
isEnabled
(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) protected boolean
isEnabled
(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8) protected boolean
isEnabled
(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9) protected boolean
boolean
isInUse()
private boolean
isValid()
void
log()
Causes all the data collected to be logged.void
log
(CharSequence message) Causes all the data collected to be logged along with the message.void
Causes all the data collected to be logged along with the message.void
Causes all the data collected to be logged along with the message.void
Logs a message with parameters.void
Logs a message with parameters.void
Logs a message with parameters.void
Logs a message with parameters.void
Logs a message with parameters.void
Logs a message with parameters.void
Logs a message with parameters.void
Logs a message with parameters.void
log
(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) Logs a message with parameters.void
log
(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8) Logs a message with parameters.void
log
(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9) Logs a message with parameters.void
Causes all the data collected to be logged along with the message and parameters.void
Causes all the data collected to be logged along with the message.void
Causes all the data collected to be logged along with the message.Causes all the data collected to be logged along with the message.private void
logMessage
(Message message) reset
(ExtendedLogger logger, Level level) This method should be considered internal.void
setEntryPoint
(String fqcn) Fully qualified class name of the entry point to the logging system.An implementation will calculate the caller's stack frame and include it in the log event.withLocation
(StackTraceElement location) Adds the specified stack trace element to the log event.withMarker
(Marker marker) Includes a Marker in the log event.withThrowable
(Throwable throwable) Includes a Throwable in the log event.
-
Field Details
-
EMPTY_MESSAGE
-
FQCN
-
LOGGER
-
logger
-
level
-
marker
-
throwable
-
location
-
inUse
private volatile boolean inUse -
threadId
private long threadId -
fqcn
-
-
Constructor Details
-
DefaultLogBuilder
-
DefaultLogBuilder
public DefaultLogBuilder()
-
-
Method Details
-
setEntryPoint
Description copied from interface:BridgeAware
Fully qualified class name of the entry point to the logging system. This class will not appear in the location information.- Specified by:
setEntryPoint
in interfaceBridgeAware
-
reset
This method should be considered internal. It is used to reset the LogBuilder for a new log message.- Parameters:
level
- The logging level for this event.- Returns:
- This LogBuilder instance.
-
withMarker
Description copied from interface:LogBuilder
Includes a Marker in the log event. Interface default method does nothing.- Specified by:
withMarker
in interfaceLogBuilder
- Parameters:
marker
- The Marker to log.- Returns:
- The LogBuilder.
-
withThrowable
Description copied from interface:LogBuilder
Includes a Throwable in the log event. Interface default method does nothing.- Specified by:
withThrowable
in interfaceLogBuilder
- Parameters:
throwable
- The Throwable to log.- Returns:
- the LogBuilder.
-
withLocation
Description copied from interface:LogBuilder
An implementation will calculate the caller's stack frame and include it in the log event. Interface default method does nothing.- Specified by:
withLocation
in interfaceLogBuilder
- Returns:
- The LogBuilder.
-
withLocation
Description copied from interface:LogBuilder
Adds the specified stack trace element to the log event. Interface default method does nothing.- Specified by:
withLocation
in interfaceLogBuilder
- Parameters:
location
- The stack trace element to include in the log event.- Returns:
- The LogBuilder.
-
isInUse
public boolean isInUse() -
log
Description copied from interface:LogBuilder
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- The message to log.
-
logAndGet
Description copied from interface:LogBuilder
Causes all the data collected to be logged along with the message.- Specified by:
logAndGet
in interfaceLogBuilder
- Parameters:
messageSupplier
- The supplier of the message to log.- Returns:
- the message logger or null if no logging occurred.
-
log
Description copied from interface:LogBuilder
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- The message to log.
-
log
Description copied from interface:LogBuilder
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- The message to log.
-
log
Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.params
- parameters to the message.- See Also:
-
log
Description copied from interface:LogBuilder
Causes all the data collected to be logged along with the message and parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- The message.params
- Parameters to the message.
-
log
Description copied from interface:LogBuilder
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
messageSupplier
- The supplier of the message to log.
-
log
Description copied from interface:LogBuilder
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- The message to log.
-
log
Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.- See Also:
-
log
Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.- See Also:
-
log
Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.- See Also:
-
log
Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.- See Also:
-
log
Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.- See Also:
-
log
Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.- See Also:
-
log
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) Description copied from interface:LogBuilder
Logs a message with parameters.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.p6
- parameter to the message.- See Also:
-
log
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.p6
- parameter to the message.p7
- parameter to the message.- See Also:
-
log
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8) Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.p6
- parameter to the message.p7
- parameter to the message.p8
- parameter to the message.- See Also:
-
log
public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9) Description copied from interface:LogBuilder
Logs a message with parameters. Interface default method does nothing.- Specified by:
log
in interfaceLogBuilder
- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.p1
- parameter to the message.p2
- parameter to the message.p3
- parameter to the message.p4
- parameter to the message.p5
- parameter to the message.p6
- parameter to the message.p7
- parameter to the message.p8
- parameter to the message.p9
- parameter to the message.- See Also:
-
log
public void log()Description copied from interface:LogBuilder
Causes all the data collected to be logged. Default implementatoin does nothing.- Specified by:
log
in interfaceLogBuilder
-
logMessage
-
isValid
private boolean isValid() -
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-
isEnabled
-