Top Description Fields Methods
org.apache.logging.log4j

public Interface LogBuilder

Known Direct Implementers
org.apache.logging.log4j.internal.DefaultLogBuilder
Imports
org.apache.logging.log4j.message.Message, org.apache.logging.log4j.util.Supplier

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

Modifier and TypeField and Description
public static final LogBuilder
NOOP

NOOP Logbuilder

Method Summary

Modifier and TypeMethod and Description
public default void
log(CharSequence
The message to log.
message
)

Causes all the data collected to be logged along with the message.

public default void
log(String
The message to log.
message
)

Causes all the data collected to be logged along with the message.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object...
parameters to the message.
params
)

Logs a message with parameters.

public default void
log(String
The message.
message
,
Supplier<?>...
Parameters to the message.
params
)
References Deprecated Supplier is deprecated or references (maybe indirectly) at least one deprecated element.

Causes all the data collected to be logged along with the message and parameters.

public default void
log(Message
The message to log.
message
)

Causes all the data collected to be logged along with the message.

public default void
log(Supplier<Message>
The supplier of the message to log.
messageSupplier
)
References Deprecated Supplier is deprecated or references (maybe indirectly) at least one deprecated element.

Causes all the data collected to be logged along with the message.

public default void
log(Object
The message to log.
message
)

Causes all the data collected to be logged along with the message.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
,
Object
parameter to the message.
p2
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
,
Object
parameter to the message.
p2
,
Object
parameter to the message.
p3
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
,
Object
parameter to the message.
p2
,
Object
parameter to the message.
p3
,
Object
parameter to the message.
p4
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
,
Object
parameter to the message.
p2
,
Object
parameter to the message.
p3
,
Object
parameter to the message.
p4
,
Object
parameter to the message.
p5
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
,
Object
parameter to the message.
p2
,
Object
parameter to the message.
p3
,
Object
parameter to the message.
p4
,
Object
parameter to the message.
p5
,
Object
parameter to the message.
p6
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
,
Object
parameter to the message.
p2
,
Object
parameter to the message.
p3
,
Object
parameter to the message.
p4
,
Object
parameter to the message.
p5
,
Object
parameter to the message.
p6
,
Object
parameter to the message.
p7
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
,
Object
parameter to the message.
p2
,
Object
parameter to the message.
p3
,
Object
parameter to the message.
p4
,
Object
parameter to the message.
p5
,
Object
parameter to the message.
p6
,
Object
parameter to the message.
p7
,
Object
parameter to the message.
p8
)

Logs a message with parameters.

public default void
log(String
the message to log; the format depends on the message factory.
message
,
Object
parameter to the message.
p0
,
Object
parameter to the message.
p1
,
Object
parameter to the message.
p2
,
Object
parameter to the message.
p3
,
Object
parameter to the message.
p4
,
Object
parameter to the message.
p5
,
Object
parameter to the message.
p6
,
Object
parameter to the message.
p7
,
Object
parameter to the message.
p8
,
Object
parameter to the message.
p9
)

Logs a message with parameters.

public default void
log()

Causes all the data collected to be logged.

public default Message

Returns:

the message logger or null if no logging occurred.
logAndGet
(final Supplier<Message>
The supplier of the message to log.
messageSupplier
)
References Deprecated Supplier is deprecated or references (maybe indirectly) at least one deprecated element.

Causes all the data collected to be logged along with the message.

public default LogBuilder

Returns:

The LogBuilder.
withLocation
()

An implementation will calculate the caller's stack frame and include it in the log event.

public default LogBuilder

Returns:

The LogBuilder.
withLocation
(StackTraceElement
The stack trace element to include in the log event.
location
)

Adds the specified stack trace element to the log event.

public default LogBuilder

Returns:

The LogBuilder.
withMarker
(Marker
The Marker to log.
marker
)

Includes a Marker in the log event.

public default LogBuilder

Returns:

the LogBuilder.
withThrowable
(Throwable
The Throwable to log.
throwable
)

Includes a Throwable in the log event.

Field Detail

NOOPback to summary
public static final LogBuilder NOOP

NOOP Logbuilder

Method Detail

logback to summary
public default void log(CharSequence message)

Causes all the data collected to be logged along with the message. Interface default method does nothing.

Parameters
message:CharSequence

The message to log.

logback to summary
public default void log(String message)

Causes all the data collected to be logged along with the message. Interface default method does nothing.

Parameters
message:String

The message to log.

logback to summary
public default void log(String message, Object... params)

Logs a message with parameters. Interface default method does nothing.

Parameters
message:String

the message to log; the format depends on the message factory.

params:Object[]

parameters to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public default void log(String message, Supplier<?>... params)

References Deprecated

Supplier is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Causes all the data collected to be logged along with the message and parameters. Interface default method does nothing.

Parameters
message:String

The message.

params:Supplier<?>[]

Parameters to the message.

Annotations
@SuppressWarnings:deprecation
logback to summary
public default void log(Message message)

Causes all the data collected to be logged along with the message. Interface default method does nothing.

Parameters
message:Message

The message to log.

logback to summary
public default void log(Supplier<Message> messageSupplier)

References Deprecated

Supplier is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Causes all the data collected to be logged along with the message. Interface default method does nothing.

Parameters
messageSupplier:Supplier<Message>

The supplier of the message to log.

Annotations
@SuppressWarnings:deprecation
logback to summary
public default void log(Object message)

Causes all the data collected to be logged along with the message. Interface default method does nothing.

Parameters
message:Object

The message to log.

logback to summary
public default void log(String message, Object p0)

Logs a message with parameters. Interface default method does nothing.

Parameters
message:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public default void log(String message, Object p0, Object p1)

Logs a message with parameters. Interface default method does nothing.

Parameters
message:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public default void log(String message, Object p0, Object p1, Object p2)

Logs a message with parameters. Interface default method does nothing.

Parameters
message:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

p2:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public default void log(String message, Object p0, Object p1, Object p2, Object p3)

Logs a message with parameters. Interface default method does nothing.

Parameters
message:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

p2:Object

parameter to the message.

p3:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4)

Logs a message with parameters. Interface default method does nothing.

Parameters
message:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

p2:Object

parameter to the message.

p3:Object

parameter to the message.

p4:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public default void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5)

Logs a message with parameters. Interface default method does nothing.

Parameters
message:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

p2:Object

parameter to the message.

p3:Object

parameter to the message.

p4:Object

parameter to the message.

p5:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public 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:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

p2:Object

parameter to the message.

p3:Object

parameter to the message.

p4:Object

parameter to the message.

p5:Object

parameter to the message.

p6:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public 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:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

p2:Object

parameter to the message.

p3:Object

parameter to the message.

p4:Object

parameter to the message.

p5:Object

parameter to the message.

p6:Object

parameter to the message.

p7:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public 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:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

p2:Object

parameter to the message.

p3:Object

parameter to the message.

p4:Object

parameter to the message.

p5:Object

parameter to the message.

p6:Object

parameter to the message.

p7:Object

parameter to the message.

p8:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public 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:String

the message to log; the format depends on the message factory.

p0:Object

parameter to the message.

p1:Object

parameter to the message.

p2:Object

parameter to the message.

p3:Object

parameter to the message.

p4:Object

parameter to the message.

p5:Object

parameter to the message.

p6:Object

parameter to the message.

p7:Object

parameter to the message.

p8:Object

parameter to the message.

p9:Object

parameter to the message.

See Also
org.apache.logging.log4j.util.Unbox
logback to summary
public default void log()

Causes all the data collected to be logged. Default implementatoin does nothing.

logAndGetback to summary
public default Message logAndGet(final Supplier<Message> messageSupplier)

References Deprecated

Supplier is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Causes all the data collected to be logged along with the message.

Parameters
messageSupplier:Supplier<Message>

The supplier of the message to log.

Returns:Message

the message logger or null if no logging occurred.

Annotations
@SuppressWarnings:deprecation
Since
2.20
withLocationback to summary
public default LogBuilder withLocation()

An implementation will calculate the caller's stack frame and include it in the log event. Interface default method does nothing.

Returns:LogBuilder

The LogBuilder.

withLocationback to summary
public default LogBuilder withLocation(StackTraceElement location)

Adds the specified stack trace element to the log event. Interface default method does nothing.

Parameters
location:StackTraceElement

The stack trace element to include in the log event.

Returns:LogBuilder

The LogBuilder.

withMarkerback to summary
public default LogBuilder withMarker(Marker marker)

Includes a Marker in the log event. Interface default method does nothing.

Parameters
marker:Marker

The Marker to log.

Returns:LogBuilder

The LogBuilder.

withThrowableback to summary
public default LogBuilder withThrowable(Throwable throwable)

Includes a Throwable in the log event. Interface default method does nothing.

Parameters
throwable:Throwable

The Throwable to log.

Returns:LogBuilder

the LogBuilder.