Uses of Interface
org.apache.logging.log4j.core.LogEvent
Package
Description
Implementation of Log4j 2.
Log4j 2 Appenders.
The classes in this package and sub packages provide appenders for various types of databases and methods for
accessing databases.
The JDBC Appender supports writing log events to a relational database using standard JDBC connections.
Message oriented middleware appenders.
Classes and interfaces for ZeroMQ/JeroMQ support.
Classes and interfaces for Kafka appender support.
The NoSQL Appender supports writing log events to NoSQL databases.
Apache Flume Appender.
Rolling File Appender and support classes.
Apache Flume Appender.
Provides Asynchronous Logger classes and interfaces for low-latency logging.
Configuration of Log4j 2.
Utility and manager classes for Log4j 2 plugins.
Visitor classes for extracting values from a Configuration or Node corresponding to a plugin annotation.
Log4j 2 Filter support.
Log4j 2 private implementation classes.
Log4j 2 Layout support.
Log4j 2 Lookups.
Log4j 2 network support.
Parsers for the output of various layouts.
Provides classes implementing format specifiers in conversion patterns.
-
Uses of LogEvent in org.apache.logging.log4j.core
Modifier and TypeClassDescriptionclass
An abstract log event implementation with default values for all methods.Modifier and TypeMethodDescriptionAbstractLogEvent.toImmutable()
Subclasses should implement this method to provide an immutable version.LogEvent.toImmutable()
Returns an immutable version of this log event, which MAY BE a copy of this event.Modifier and TypeMethodDescriptionvoid
Logs a LogEvent using whatever logic this Appender wishes to use.void
Handle an error with a message, and exception and a logging event.Filter an event.void
void
byte[]
Layout.toByteArray
(LogEvent event) Formats the event suitable for display.Layout.toSerializable
(LogEvent event) Formats the event as an Object that can be serialized. -
Uses of LogEvent in org.apache.logging.log4j.core.appender
Modifier and TypeMethodDescriptionvoid
Actual writing occurs here.void
Actual writing occurs here.void
Actual writing occurs here.void
void
Handle the Log event.void
void
void
Writes the log entry rolling over the file when required.void
Write the log entry rolling over the file when required.void
void
Perform SmtpAppender specific appending actions, mainly adding the event to a cyclic buffer and checking if the event triggers an e-mail to be sent.protected void
AbstractOutputStreamAppender.directEncodeEvent
(LogEvent event) protected void
SocketAppender.directEncodeEvent
(LogEvent event) void
Handle an error with a message, exception, and a logging event, using theErrorHandler
configured for this Appender.void
Handle an error with a message, an exception, and a logging event.boolean
SmtpAppender.isFiltered
(LogEvent event) Capture all events in CyclicBuffer.void
AsyncAppender.logMessageInBackgroundThread
(LogEvent logEvent) FOR INTERNAL USE ONLY.void
AsyncAppender.logMessageInCurrentThread
(LogEvent logEvent) FOR INTERNAL USE ONLY.abstract void
void
protected Serializable
AbstractAppender.toSerializable
(LogEvent event) Serializes the given event using the appender's layout if present.protected void
AbstractOutputStreamAppender.writeByteArrayToManager
(LogEvent event) Modifier and TypeMethodDescriptionAsyncAppender.Builder.setBlockingQueueFactory
(BlockingQueueFactory<LogEvent> blockingQueueFactory) -
Uses of LogEvent in org.apache.logging.log4j.core.appender.db
Modifier and TypeMethodDescriptionAbstractDatabaseAppender.getLayout()
This always returnsnull
, as database appenders do not use a single layout.Modifier and TypeMethodDescriptionfinal void
protected void
final void
Deprecated.final void
AbstractDatabaseManager.write
(LogEvent event, Serializable serializable) This method manages buffering and writing of events.protected void
AbstractDatabaseManager.writeInternal
(LogEvent event) Deprecated.protected abstract void
AbstractDatabaseManager.writeInternal
(LogEvent event, Serializable serializable) Performs the actual writing of the event in an implementation-specific way.protected void
AbstractDatabaseManager.writeThrough
(LogEvent event, Serializable serializable) -
Uses of LogEvent in org.apache.logging.log4j.core.appender.db.jdbc
Modifier and TypeMethodDescriptionprotected void
JdbcDatabaseManager.writeInternal
(LogEvent event, Serializable serializable) protected void
JdbcDatabaseManager.writeThrough
(LogEvent event, Serializable serializable) -
Uses of LogEvent in org.apache.logging.log4j.core.appender.mom
-
Uses of LogEvent in org.apache.logging.log4j.core.appender.mom.jeromq
-
Uses of LogEvent in org.apache.logging.log4j.core.appender.mom.kafka
-
Uses of LogEvent in org.apache.logging.log4j.core.appender.nosql
Modifier and TypeMethodDescriptionprotected void
NoSqlDatabaseManager.writeInternal
(LogEvent event, Serializable serializable) -
Uses of LogEvent in org.apache.logging.log4j.core.appender.rewrite
Modifier and TypeMethodDescriptionRewrite the event.Rewrites the event.Rewrite a logging event.Modifier and TypeMethodDescriptionvoid
Modifies the event and pass to the subordinate Appenders.Rewrite the event.Rewrites the event.Rewrite a logging event. -
Uses of LogEvent in org.apache.logging.log4j.core.appender.rolling
Modifier and TypeMethodDescriptionvoid
RollingFileManager.checkRollover
(LogEvent event) Determines if a rollover should occur.boolean
CompositeTriggeringPolicy.isTriggeringEvent
(LogEvent event) Determines if a rollover should occur.boolean
CronTriggeringPolicy.isTriggeringEvent
(LogEvent event) Determines whether a rollover should occur.boolean
NoOpTriggeringPolicy.isTriggeringEvent
(LogEvent logEvent) boolean
OnStartupTriggeringPolicy.isTriggeringEvent
(LogEvent event) Determine if a rollover should be triggered.boolean
SizeBasedTriggeringPolicy.isTriggeringEvent
(LogEvent event) Returns true if a rollover should occur.boolean
TimeBasedTriggeringPolicy.isTriggeringEvent
(LogEvent event) Determines whether a rollover should occur.boolean
TriggeringPolicy.isTriggeringEvent
(LogEvent logEvent) Determines if a rollover may be appropriate at this time. -
Uses of LogEvent in org.apache.logging.log4j.core.appender.routing
Modifier and TypeMethodDescriptionvoid
Routes.getPattern
(LogEvent event, ConcurrentMap<Object, Object> scriptStaticVariables) Returns the pattern.void
void
-
Uses of LogEvent in org.apache.logging.log4j.core.async
Modifier and TypeClassDescriptionclass
When the Disruptor is started, the RingBuffer is populated with event objects.Modifier and TypeMethodDescriptionRingBufferLogEvent.createMemento()
Creates and returns a new immutable copy of thisRingBufferLogEvent
.RingBufferLogEvent.toImmutable()
Modifier and TypeMethodDescriptionprotected void
AsyncLoggerConfig.callAppenders
(LogEvent event) void
AsyncLoggerConfigDelegate.enqueueEvent
(LogEvent event, AsyncLoggerConfig asyncLoggerConfig) Enqueues theLogEvent
on the mixed configuration ringbuffer.void
AsyncLoggerConfigDisruptor.enqueueEvent
(LogEvent event, AsyncLoggerConfig asyncLoggerConfig) protected void
AsyncLoggerConfig.log
(LogEvent event, LoggerConfig.LoggerConfigPredicate predicate) abstract void
EventRoute.logMessage
(AsyncAppender asyncAppender, LogEvent coreEvent) abstract void
EventRoute.logMessage
(AsyncLoggerConfig asyncLoggerConfig, LogEvent event) boolean
AsyncLoggerConfigDelegate.tryEnqueue
(LogEvent event, AsyncLoggerConfig asyncLoggerConfig) boolean
AsyncLoggerConfigDisruptor.tryEnqueue
(LogEvent event, AsyncLoggerConfig asyncLoggerConfig) -
Uses of LogEvent in org.apache.logging.log4j.core.config
Modifier and TypeMethodDescriptionvoid
AppenderControl.callAppender
(LogEvent event) Call the appender.protected void
LoggerConfig.callAppenders
(LogEvent event) void
AbstractConfiguration.createConfiguration
(Node node, LogEvent event) void
Configuration.createConfiguration
(Node node, LogEvent event) void
AwaitCompletionReliabilityStrategy.log
(Supplier<LoggerConfig> reconfigured, LogEvent event) void
AwaitUnconditionallyReliabilityStrategy.log
(Supplier<LoggerConfig> reconfigured, LogEvent event) void
DefaultReliabilityStrategy.log
(Supplier<LoggerConfig> reconfigured, LogEvent event) void
LockingReliabilityStrategy.log
(Supplier<LoggerConfig> reconfigured, LogEvent event) void
Logs an event.protected void
LoggerConfig.log
(LogEvent event, LoggerConfig.LoggerConfigPredicate predicate) Logs an event.void
ReliabilityStrategy.log
(Supplier<LoggerConfig> reconfigured, LogEvent event) Logs an event.protected void
LoggerConfig.processLogEvent
(LogEvent event, LoggerConfig.LoggerConfigPredicate predicate) Logs an event, bypassing filters. -
Uses of LogEvent in org.apache.logging.log4j.core.config.plugins.util
Modifier and TypeMethodDescriptionPluginBuilder.forLogEvent
(LogEvent event) Specifies the LogEvent that may be used to provide extra context for string substitutions. -
Uses of LogEvent in org.apache.logging.log4j.core.config.plugins.visitors
Modifier and TypeMethodDescriptionPluginAttributeVisitor.visit
(Configuration configuration, Node node, LogEvent event, StringBuilder log) PluginBuilderAttributeVisitor.visit
(Configuration configuration, Node node, LogEvent event, StringBuilder log) PluginConfigurationVisitor.visit
(Configuration configuration, Node node, LogEvent event, StringBuilder log) PluginElementVisitor.visit
(Configuration configuration, Node node, LogEvent event, StringBuilder log) PluginLoggerContextVisitor.visit
(Configuration configuration, Node node, LogEvent event, StringBuilder log) PluginNodeVisitor.visit
(Configuration configuration, Node node, LogEvent event, StringBuilder log) PluginValueVisitor.visit
(Configuration configuration, Node node, LogEvent event, StringBuilder log) PluginVisitor.visit
(Configuration configuration, Node node, LogEvent event, StringBuilder log) Visits a Node to obtain a value for constructing a Plugin object. -
Uses of LogEvent in org.apache.logging.log4j.core.filter
Modifier and TypeMethodDescriptionContext Filter method.Filter an event.boolean
AbstractFilterable.isFiltered
(LogEvent event) Determine if the LogEvent should be processed or ignored.boolean
Filterable.isFiltered
(LogEvent event) Determines if the event should be filtered. -
Uses of LogEvent in org.apache.logging.log4j.core.impl
Modifier and TypeClassDescriptionclass
Implementation of a LogEvent.class
Mutable implementation of theLogEvent
interface.Modifier and TypeMethodDescriptionDefaultLogEventFactory.createEvent
(String loggerName, Marker marker, String fqcn, StackTraceElement location, Level level, Message data, List<Property> properties, Throwable t) Creates a log event.DefaultLogEventFactory.createEvent
(String loggerName, Marker marker, String fqcn, Level level, Message data, List<Property> properties, Throwable t) Creates a log event.LocationAwareLogEventFactory.createEvent
(String loggerName, Marker marker, String fqcn, StackTraceElement location, Level level, Message data, List<Property> properties, Throwable t) default LogEvent
LogEventFactory.createEvent
(String loggerName, Marker marker, String fqcn, StackTraceElement location, Level level, Message data, List<Property> properties, Throwable t) LogEventFactory.createEvent
(String loggerName, Marker marker, String fqcn, Level level, Message data, List<Property> properties, Throwable t) ReusableLogEventFactory.createEvent
(String loggerName, Marker marker, String fqcn, StackTraceElement location, Level level, Message message, List<Property> properties, Throwable t) Creates a log event.ReusableLogEventFactory.createEvent
(String loggerName, Marker marker, String fqcn, Level level, Message message, List<Property> properties, Throwable t) Creates a log event.static LogEvent
Log4jLogEvent.createMemento
(LogEvent logEvent) Modifier and TypeMethodDescriptionstatic LogEvent
Log4jLogEvent.createMemento
(LogEvent logEvent) static Log4jLogEvent
Log4jLogEvent.createMemento
(LogEvent event, boolean includeLocation) Creates and returns a new immutable copy of thisLog4jLogEvent
.void
Initialize the fields of thisMutableLogEvent
from another event.static void
Switches thereserved
flag off if the specified event is a MutableLogEvent, otherwise does nothing.static Serializable
Take a snapshot of the specifiedLogEvent
. -
Uses of LogEvent in org.apache.logging.log4j.core.layout
Modifier and TypeMethodDescriptionSerializedLayout.toSerializable
(LogEvent event) Deprecated.Returns the LogEvent.Modifier and TypeMethodDescriptionvoid
AbstractLayout.encode
(LogEvent event, ByteBufferDestination destination) Encodes the specified source LogEvent to some binary representation and writes the result to the specified destination.void
GelfLayout.encode
(LogEvent event, ByteBufferDestination destination) void
PatternLayout.encode
(LogEvent event, ByteBufferDestination destination) LevelPatternSelector.getFormatters
(LogEvent event) MarkerPatternSelector.getFormatters
(LogEvent event) PatternSelector.getFormatters
(LogEvent event) ScriptPatternSelector.getFormatters
(LogEvent event) void
PatternLayout.serialize
(LogEvent event, StringBuilder stringBuilder) byte[]
AbstractStringLayout.toByteArray
(LogEvent event) Formats the Log Event as a byte array.byte[]
GelfLayout.toByteArray
(LogEvent event) byte[]
MessageLayout.toByteArray
(LogEvent event) byte[]
SerializedLayout.toByteArray
(LogEvent event) Deprecated.Formats aLogEvent
as a serialized byte array of the LogEvent object.AbstractStringLayout.Serializer.toSerializable
(LogEvent event) default StringBuilder
AbstractStringLayout.Serializer.toSerializable
(LogEvent event, StringBuilder builder) AbstractStringLayout.Serializer2.toSerializable
(LogEvent event, StringBuilder builder) CsvLogEventLayout.toSerializable
(LogEvent event) CsvParameterLayout.toSerializable
(LogEvent event) GelfLayout.toSerializable
(LogEvent event) HtmlLayout.toSerializable
(LogEvent event) Formats as a String.void
JsonLayout.toSerializable
(LogEvent event, Writer writer) MessageLayout.toSerializable
(LogEvent event) PatternLayout.toSerializable
(LogEvent event) Formats a logging event to a writer.Rfc5424Layout.toSerializable
(LogEvent event) Formats aLogEvent
in conformance with the RFC 5424 Syslog specification.SerializedLayout.toSerializable
(LogEvent event) Deprecated.Returns the LogEvent.SyslogLayout.toSerializable
(LogEvent event) Formats aLogEvent
in conformance with the BSD Log record format. -
Uses of LogEvent in org.apache.logging.log4j.core.lookup
Modifier and TypeMethodDescriptionResolves the specified variable.default LookupResult
Same asStrLookup.lookup(LogEvent, String)
, but provides additional metadata describing the result.Looks up the value from the ThreadContext Map.Looks up d the current date or the date in the LogEvent.Looks up the value of the environment variable.Looks up the value from the logging event.Resolves the specified variable.Looks up the value of the environment variable.Looks up the value of the JNDI resource.Converts the "key" to lower case.Looks up the value for the key in the format "BundleName:BundleKey".Looks up a String key to a String value possibly using the current LogEvent.Looks up the value for the key using the data in the LogEvent.Looks up the value for the key using the data in the LogEvent.Converts the "key" to upper case.Replaces all the occurrences of variables with their matching values from the resolver using the given source array as a template.Replaces all the occurrences of variables with their matching values from the resolver using the given source array as a template.Replaces all the occurrences of variables in the given source object with their matching values from the resolver.Replaces all the occurrences of variables with their matching values from the resolver using the given source string as a template.StrSubstitutor.replace
(LogEvent event, StringBuffer source) Replaces all the occurrences of variables with their matching values from the resolver using the given source buffer as a template.StrSubstitutor.replace
(LogEvent event, StringBuffer source, int offset, int length) Replaces all the occurrences of variables with their matching values from the resolver using the given source buffer as a template.StrSubstitutor.replace
(LogEvent event, StringBuilder source) Replaces all the occurrences of variables with their matching values from the resolver using the given source builder as a template.StrSubstitutor.replace
(LogEvent event, StringBuilder source, int offset, int length) Replaces all the occurrences of variables with their matching values from the resolver using the given source builder as a template.Replaces all the occurrences of variables with their matching values from the resolver using the given source string as a template.boolean
StrSubstitutor.replaceIn
(LogEvent event, StringBuffer source, int offset, int length) Replaces all the occurrences of variables within the given source buffer with their matching values from the resolver.boolean
StrSubstitutor.replaceIn
(LogEvent event, StringBuilder source) Replaces all the occurrences of variables within the given source builder with their matching values from the resolver.boolean
StrSubstitutor.replaceIn
(LogEvent event, StringBuilder source, int offset, int length) Replaces all the occurrences of variables within the given source builder with their matching values from the resolver.protected LookupResult
StrSubstitutor.resolveVariable
(LogEvent event, String variableName, StringBuilder buf, int startPos, int endPos) Internal method that resolves the value of a variable.protected boolean
StrSubstitutor.substitute
(LogEvent event, StringBuilder buf, int offset, int length) Internal method that substitutes the variables. -
Uses of LogEvent in org.apache.logging.log4j.core.net
Modifier and TypeMethodDescriptionabstract void
Adds an event to the cyclic buffer.void
protected byte[]
SmtpManager.formatContentToBytes
(LogEvent[] priorEvents, LogEvent appendEvent, Layout<?> layout) abstract void
MailManager.sendEvents
(Layout<?> layout, LogEvent appendEvent) Send the contents of the cyclic buffer as an e-mail message.void
SmtpManager.sendEvents
(Layout<?> layout, LogEvent appendEvent) protected void
SmtpManager.writeBuffer
(LogEvent[] priorEvents, LogEvent appendEvent, Layout<?> layout, OutputStream out) -
Uses of LogEvent in org.apache.logging.log4j.core.parser
Modifier and TypeMethodDescriptionLogEventParser.parseFrom
(byte[] input) Parses a byte array, which is expected to contain exactly one log event.LogEventParser.parseFrom
(byte[] input, int offset, int length) Parses a specified range in a byte array.Parses a String, which is expected to contain exactly one log event. -
Uses of LogEvent in org.apache.logging.log4j.core.pattern
Modifier and TypeMethodDescriptionvoid
AbstractStyleNameConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
ClassNamePatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Format a logging event.void
DatePatternConverter.format
(LogEvent event, StringBuilder output) Formats an event into a string buffer.void
EncodingPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
EndOfBatchPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
EqualsBaseReplacementConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
ExtendedThrowablePatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
FileLocationPatternConverter.format
(LogEvent event, StringBuilder output) Formats an event into a string buffer.void
FullLocationPatternConverter.format
(LogEvent event, StringBuilder output) Formats an event into a string buffer.void
HighlightConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
LevelPatternConverter.format
(LogEvent event, StringBuilder output) Formats an event into a string buffer.void
LineLocationPatternConverter.format
(LogEvent event, StringBuilder output) Formats an event into a string buffer.void
LineSeparatorPatternConverter.format
(LogEvent ignored, StringBuilder toAppendTo) Formats an event into a string buffer.void
LiteralPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.abstract void
LogEventPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
LoggerFqcnPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
LoggerPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
MapPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
MarkerPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
MarkerSimpleNamePatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
MaxLengthConverter.format
(LogEvent event, StringBuilder toAppendTo) void
MdcPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
MessagePatternConverter.format
(LogEvent event, StringBuilder toAppendTo) void
MethodLocationPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
NanoTimePatternConverter.format
(LogEvent event, StringBuilder output) Formats an event into a string buffer.void
NdcPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) void
PatternFormatter.format
(LogEvent event, StringBuilder buf) void
ProcessIdPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
RegexReplacementConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
RelativeTimePatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
RepeatPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Adds the repeated String to the buffer.void
RootThrowablePatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
SequenceNumberPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
StyleConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
ThreadIdPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
ThreadNamePatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
ThreadPriorityPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
ThrowablePatternConverter.format
(LogEvent event, StringBuilder buffer) Formats an event into a string buffer.void
UuidPatternConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.void
VariablesNotEmptyReplacementConverter.format
(LogEvent event, StringBuilder toAppendTo) Formats an event into a string buffer.protected String
AbstractDatabaseManager.write(LogEvent, Serializable)
.