public interface LoggingEventBuilder
logging events
.Modifier and Type | Method and Description |
---|---|
LoggingEventBuilder |
addArgument(Object p)
Add an argument to the event being built.
|
LoggingEventBuilder |
addArgument(Supplier<?> objectSupplier)
Add an argument supplier to the event being built.
|
LoggingEventBuilder |
addKeyValue(String key,
Object value)
Add a
key value pair to the event being built. |
LoggingEventBuilder |
addKeyValue(String key,
Supplier<Object> valueSupplier)
Add a
key value pair to the event being built. |
LoggingEventBuilder |
addMarker(Marker marker)
A
marker to the event being built. |
void |
log()
After the logging event is built, performs actual logging.
|
void |
log(String message)
Equivalent to calling
setMessage(String) followed by log() ; |
void |
log(String message,
Object... args)
Equivalent to calling
setMessage(String) followed by zero or more calls to
addArgument(Object) (depending on the size of args array) and then log() |
void |
log(String message,
Object arg)
|
void |
log(String message,
Object arg0,
Object arg1)
Equivalent to calling
setMessage(String) followed by two calls to
addArgument(Object) and then log() |
void |
log(Supplier<String> messageSupplier)
Equivalent to calling
setMessage(Supplier) followed by log() |
LoggingEventBuilder |
setCause(Throwable cause)
Set the cause for the logging event being built.
|
LoggingEventBuilder |
setMessage(String message)
Sets the message of the logging event.
|
LoggingEventBuilder |
setMessage(Supplier<String> messageSupplier)
Sets the message of the event via a message supplier.
|
@CheckReturnValue LoggingEventBuilder setCause(Throwable cause)
cause
- a throwable@CheckReturnValue LoggingEventBuilder addMarker(Marker marker)
marker
to the event being built.marker
- a Marker instance to add.@CheckReturnValue LoggingEventBuilder addArgument(Object p)
p
- an Object to add.@CheckReturnValue LoggingEventBuilder addArgument(Supplier<?> objectSupplier)
objectSupplier
- an Object supplier to add.@CheckReturnValue LoggingEventBuilder addKeyValue(String key, Object value)
key value pair
to the event being built.key
- the key of the key value pair.value
- the value of the key value pair.@CheckReturnValue LoggingEventBuilder addKeyValue(String key, Supplier<Object> valueSupplier)
key value pair
to the event being built.key
- the key of the key value pair.valueSupplier
- a supplier of a value for the key value pair.@CheckReturnValue LoggingEventBuilder setMessage(String message)
@CheckReturnValue LoggingEventBuilder setMessage(Supplier<String> messageSupplier)
messageSupplier
- supplies a String to be used as the message for the eventvoid log()
log()
is omitted, a LoggingEvent
will be built but no logging will occur.void log(String message)
setMessage(String)
followed by log()
;message
- the message to logvoid log(String message, Object arg)
message
- the message to logarg
- an argument to be used with the message to logvoid log(String message, Object arg0, Object arg1)
setMessage(String)
followed by two calls to
addArgument(Object)
and then log()
message
- the message to logarg0
- first argument to be used with the message to logarg1
- second argument to be used with the message to logvoid log(String message, Object... args)
setMessage(String)
followed by zero or more calls to
addArgument(Object)
(depending on the size of args array) and then log()
message
- the message to logargs
- a list (actually an array) of arguments to be used with the message to logvoid log(Supplier<String> messageSupplier)
setMessage(Supplier)
followed by log()
messageSupplier
- a Supplier returning a message of type StringCopyright © 2005–2022 QOS.ch. All rights reserved.