Class Log4jLogEvent.Builder
- java.lang.Object
-
- org.apache.logging.log4j.core.impl.Log4jLogEvent.Builder
-
- Enclosing class:
- Log4jLogEvent
public static class Log4jLogEvent.Builder extends java.lang.Object implements Builder<LogEvent>
LogEvent Builder helper class.
-
-
Field Summary
Fields Modifier and Type Field Description private StringMapcontextDataprivate ThreadContext.ContextStackcontextStackprivate booleanendOfBatchprivate booleanincludeLocationprivate MutableInstantinstantprivate Levellevelprivate java.lang.StringloggerFqcnprivate java.lang.StringloggerNameprivate Markermarkerprivate Messagemessageprivate longnanoTimeprivate java.lang.StackTraceElementsourceprivate longthreadIdprivate java.lang.StringthreadNameprivate intthreadPriorityprivate java.lang.Throwablethrownprivate ThrowableProxythrownProxy
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix, isValid
-
-
-
-
Field Detail
-
loggerFqcn
private java.lang.String loggerFqcn
-
marker
private Marker marker
-
level
private Level level
-
loggerName
private java.lang.String loggerName
-
message
private Message message
-
thrown
private java.lang.Throwable thrown
-
instant
private final MutableInstant instant
-
thrownProxy
private ThrowableProxy thrownProxy
-
contextData
private StringMap contextData
-
contextStack
private ThreadContext.ContextStack contextStack
-
threadId
private long threadId
-
threadName
private java.lang.String threadName
-
threadPriority
private int threadPriority
-
source
private java.lang.StackTraceElement source
-
includeLocation
private boolean includeLocation
-
endOfBatch
private boolean endOfBatch
-
nanoTime
private long nanoTime
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(LogEvent other)
-
-
Method Detail
-
setLevel
public Log4jLogEvent.Builder setLevel(Level level)
-
setLoggerFqcn
public Log4jLogEvent.Builder setLoggerFqcn(java.lang.String loggerFqcn)
-
setLoggerName
public Log4jLogEvent.Builder setLoggerName(java.lang.String loggerName)
-
setMarker
public Log4jLogEvent.Builder setMarker(Marker marker)
-
setMessage
public Log4jLogEvent.Builder setMessage(Message message)
-
setThrown
public Log4jLogEvent.Builder setThrown(java.lang.Throwable thrown)
-
setTimeMillis
public Log4jLogEvent.Builder setTimeMillis(long timeMillis)
-
setInstant
public Log4jLogEvent.Builder setInstant(Instant instant)
-
setThrownProxy
public Log4jLogEvent.Builder setThrownProxy(ThrowableProxy thrownProxy)
-
setContextMap
@Deprecated public Log4jLogEvent.Builder setContextMap(java.util.Map<java.lang.String,java.lang.String> contextMap)
Deprecated.
-
setContextData
public Log4jLogEvent.Builder setContextData(StringMap contextData)
-
setContextStack
public Log4jLogEvent.Builder setContextStack(ThreadContext.ContextStack contextStack)
-
setThreadId
public Log4jLogEvent.Builder setThreadId(long threadId)
-
setThreadName
public Log4jLogEvent.Builder setThreadName(java.lang.String threadName)
-
setThreadPriority
public Log4jLogEvent.Builder setThreadPriority(int threadPriority)
-
setSource
public Log4jLogEvent.Builder setSource(java.lang.StackTraceElement source)
-
setIncludeLocation
public Log4jLogEvent.Builder setIncludeLocation(boolean includeLocation)
-
setEndOfBatch
public Log4jLogEvent.Builder setEndOfBatch(boolean endOfBatch)
-
setNanoTime
public Log4jLogEvent.Builder setNanoTime(long nanoTime)
Sets the nano time for the event.- Parameters:
nanoTime- The value of the running Java Virtual Machine's high-resolution time source when the event was created.- Returns:
- this builder
-
build
public Log4jLogEvent build()
Description copied from interface:BuilderBuilds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.
-
initTimeFields
private void initTimeFields()
-
-