Package org.apache.logging.log4j
Interface LogBuilder
public interface LogBuilder
Interface for constructing log events before logging them. Instances of LogBuilders should only be created
by calling one of the Logger methods that return a LogBuilder.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
log()
Causes all the data collected to be logged.default void
log
(CharSequence message) Causes all the data collected to be logged along with the message.default void
Causes all the data collected to be logged along with the message.default void
Causes all the data collected to be logged along with the message.default void
Logs a message with parameters.default void
Logs a message with parameters.default void
Logs a message with parameters.default void
Logs a message with parameters.default void
Logs a message with parameters.default void
Logs a message with parameters.default void
Logs a message with parameters.default void
Logs a message with parameters.default 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.default 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.default 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.default void
Causes all the data collected to be logged along with the message and parameters.default void
Causes all the data collected to be logged along with the message.default void
Causes all the data collected to be logged along with the message.default Message
Causes all the data collected to be logged along with the message.default LogBuilder
An implementation will calculate the caller's stack frame and include it in the log event.default LogBuilder
withLocation
(StackTraceElement location) Adds the specified stack trace element to the log event.default LogBuilder
withMarker
(Marker marker) Includes a Marker in the log event.default LogBuilder
withThrowable
(Throwable throwable) Includes a Throwable in the log event.
-
Field Details
-
NOOP
NOOP Logbuilder
-
-
Method Details
-
withMarker
Includes a Marker in the log event. Interface default method does nothing.- Parameters:
marker
- The Marker to log.- Returns:
- The LogBuilder.
-
withThrowable
Includes a Throwable in the log event. Interface default method does nothing.- Parameters:
throwable
- The Throwable to log.- Returns:
- the LogBuilder.
-
withLocation
An implementation will calculate the caller's stack frame and include it in the log event. Interface default method does nothing.- Returns:
- The LogBuilder.
-
withLocation
Adds the specified stack trace element to the log event. Interface default method does nothing.- Parameters:
location
- The stack trace element to include in the log event.- Returns:
- The LogBuilder.
-
log
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Parameters:
message
- The message to log.
-
log
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Parameters:
message
- The message to log.
-
log
Logs a message with parameters. Interface default method does nothing.- Parameters:
message
- the message to log; the format depends on the message factory.params
- parameters to the message.- See Also:
-
log
Causes all the data collected to be logged along with the message and parameters. Interface default method does nothing.- Parameters:
message
- The message.params
- Parameters to the message.
-
log
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Parameters:
message
- The message to log.
-
log
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Parameters:
messageSupplier
- The supplier of the message to log.
-
logAndGet
Causes all the data collected to be logged along with the message.- Parameters:
messageSupplier
- The supplier of the message to log.- Returns:
- the message logger or
null
if no logging occurred. - Since:
- 2.20
-
log
Causes all the data collected to be logged along with the message. Interface default method does nothing.- Parameters:
message
- The message to log.
-
log
Logs a message with parameters. Interface default method does nothing.- Parameters:
message
- the message to log; the format depends on the message factory.p0
- parameter to the message.- See Also:
-
log
Logs a message with parameters. Interface default method does nothing.- 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
Logs a message with parameters. Interface default method does nothing.- 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
Logs a message with parameters. Interface default method does nothing.- 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
Logs a message with parameters. Interface default method does nothing.- 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
Logs a message with parameters. Interface default method does nothing.- 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
default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) Logs a message with parameters.- 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
default 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. Interface default method does nothing.- 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
default 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. Interface default method does nothing.- 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
default 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. Interface default method does nothing.- 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
default void log()Causes all the data collected to be logged. Default implementatoin does nothing.
-