Class DefaultLogBuilder
java.lang.Object
org.apache.logging.log4j.internal.DefaultLogBuilder
- All Implemented Interfaces:
LogBuilder
Collects data for a log event and then logs it. This class should be considered private.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Messageprivate static final Stringprivate booleanprivate Levelprivate StackTraceElementprivate final Loggerprivate static final Loggerprivate Markerprivate longprivate ThrowableFields inherited from interface org.apache.logging.log4j.LogBuilder
NOOP -
Constructor Summary
ConstructorsConstructorDescriptionDefaultLogBuilder(Logger logger) DefaultLogBuilder(Logger logger, Level level) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisInUse()private booleanisValid()voidlog()Causes all the data collected to be logged.voidlog(CharSequence message) Causes all the data collected to be logged along with the message.voidCauses all the data collected to be logged along with the message.voidCauses all the data collected to be logged along with the message.voidLogs a message with parameters.voidLogs a message with parameters.voidLogs a message with parameters.voidLogs a message with parameters.voidLogs a message with parameters.voidLogs a message with parameters.voidLogs a message with parameters.voidLogs a message with parameters.voidlog(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) Logs a message with parameters.voidlog(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.voidlog(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.voidCauses all the data collected to be logged along with the message and parameters.voidCauses all the data collected to be logged along with the message.voidCauses all the data collected to be logged along with the message.private voidlogMessage(Message message) This method should be considered internal.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
-
-
Constructor Details
-
DefaultLogBuilder
-
DefaultLogBuilder
-
-
Method Details
-
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:LogBuilderIncludes a Marker in the log event. Interface default method does nothing.- Specified by:
withMarkerin interfaceLogBuilder- Parameters:
marker- The Marker to log.- Returns:
- The LogBuilder.
-
withThrowable
Description copied from interface:LogBuilderIncludes a Throwable in the log event. Interface default method does nothing.- Specified by:
withThrowablein interfaceLogBuilder- Parameters:
throwable- The Throwable to log.- Returns:
- the LogBuilder.
-
withLocation
Description copied from interface:LogBuilderAn implementation will calculate the caller's stack frame and include it in the log event. Interface default method does nothing.- Specified by:
withLocationin interfaceLogBuilder- Returns:
- The LogBuilder.
-
withLocation
Description copied from interface:LogBuilderAdds the specified stack trace element to the log event. Interface default method does nothing.- Specified by:
withLocationin 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:LogBuilderCauses all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
login interfaceLogBuilder- Parameters:
message- The message to log.
-
log
Description copied from interface:LogBuilderCauses all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
login interfaceLogBuilder- Parameters:
message- The message to log.
-
log
Description copied from interface:LogBuilderCauses all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
login interfaceLogBuilder- Parameters:
message- The message to log.
-
log
Description copied from interface:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderCauses all the data collected to be logged along with the message and parameters. Interface default method does nothing.- Specified by:
login interfaceLogBuilder- Parameters:
message- The message.params- Parameters to the message.
-
log
Description copied from interface:LogBuilderCauses all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
login interfaceLogBuilder- Parameters:
messageSupplier- The supplier of the message to log.
-
log
Description copied from interface:LogBuilderCauses all the data collected to be logged along with the message. Interface default method does nothing.- Specified by:
login interfaceLogBuilder- Parameters:
message- The message to log.
-
log
Description copied from interface:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderLogs a message with parameters.- Specified by:
login 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:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderLogs a message with parameters. Interface default method does nothing.- Specified by:
login 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:LogBuilderCauses all the data collected to be logged. Default implementatoin does nothing.- Specified by:
login interfaceLogBuilder
-
logMessage
-
isValid
private boolean isValid()
-