blob: c85791e64a337a6671652a76e8455e8e3d9a485a [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>LogEvent (Apache Log4j Core 2.23.1 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.logging.log4j.core, interface: LogEvent">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/LogEvent.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.logging.log4j.core</a></div>
<h1 title="Interface LogEvent" class="title">Interface LogEvent</h1>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Superinterfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code></dd>
</dl>
<dl class="notes">
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="AbstractLogEvent.html" title="class in org.apache.logging.log4j.core">AbstractLogEvent</a></code>, <code><a href="impl/Log4jLogEvent.html" title="class in org.apache.logging.log4j.core.impl">Log4jLogEvent</a></code>, <code><a href="impl/MutableLogEvent.html" title="class in org.apache.logging.log4j.core.impl">MutableLogEvent</a></code>, <code><a href="async/RingBufferLogEvent.html" title="class in org.apache.logging.log4j.core.async">RingBufferLogEvent</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">LogEvent</span><span class="extends-implements">
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></span></div>
<div class="block">Provides contextual information about a logged message. A LogEvent must be <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" title="class or interface in java.io" class="external-link"><code>Serializable</code></a> so that it
may be transmitted over a network connection, output in a
<a href="layout/SerializedLayout.html" title="class in org.apache.logging.log4j.core.layout"><code>SerializedLayout</code></a>, and many other uses. Besides containing a
<a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/message/Message.html" title="class or interface in org.apache.logging.log4j.message" class="external-link"><code>Message</code></a>, a LogEvent has a corresponding
<a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/Level.html" title="class or interface in org.apache.logging.log4j" class="external-link"><code>Level</code></a> that the message was logged at. If a
<a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/Marker.html" title="class or interface in org.apache.logging.log4j" class="external-link"><code>Marker</code></a> was used, then it is included here. The contents of the
<a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/ThreadContext.html" title="class or interface in org.apache.logging.log4j" class="external-link"><code>ThreadContext</code></a> at the time of the log call are provided via
<a href="#getContextMap()"><code>getContextMap()</code></a> and <a href="#getContextStack()"><code>getContextStack()</code></a>. If a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link"><code>Throwable</code></a> was included in the log
call, then it is provided via <a href="#getThrown()"><code>getThrown()</code></a>. When this class is serialized, the attached Throwable will
be wrapped into a <a href="impl/ThrowableProxy.html" title="class in org.apache.logging.log4j.core.impl"><code>ThrowableProxy</code></a> so that it may be safely serialized
and deserialized properly without causing problems if the exception class is not available on the other end.
<p>
Since version 2.7, <a href="#getContextMap()"><code>getContextMap()</code></a> is deprecated in favor of <a href="#getContextData()"><code>getContextData()</code></a>, which
can carry both <code>ThreadContext</code> data as well as other context data supplied by the
<a href="impl/ContextDataInjectorFactory.html" title="class in org.apache.logging.log4j.core.impl">configured</a>
<a href="ContextDataInjector.html" title="interface in org.apache.logging.log4j.core"><code>ContextDataInjector</code></a>.
</p></div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button><button id="method-summary-table-tab6" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab6', 3)" class="table-tab">Deprecated Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/util/ReadOnlyStringMap.html" title="class or interface in org.apache.logging.log4j.util" class="external-link">ReadOnlyStringMap</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getContextData()" class="member-name-link">getContextData</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the <code>ReadOnlyStringMap</code> object holding context data key-value pairs.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3 method-summary-table-tab6"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3 method-summary-table-tab6"><code><a href="#getContextMap()" class="member-name-link">getContextMap</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3 method-summary-table-tab6">
<div class="block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">use <a href="#getContextData()"><code>getContextData()</code></a> instead</div>
</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/ThreadContext.ContextStack.html" title="class or interface in org.apache.logging.log4j" class="external-link">ThreadContext.ContextStack</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getContextStack()" class="member-name-link">getContextStack</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the context stack (also known as Nested Diagnostic Context or NDC).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="time/Instant.html" title="interface in org.apache.logging.log4j.core.time">Instant</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getInstant()" class="member-name-link">getInstant</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the Instant when the message was logged.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/Level.html" title="class or interface in org.apache.logging.log4j" class="external-link">Level</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getLevel()" class="member-name-link">getLevel</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the level.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getLoggerFqcn()" class="member-name-link">getLoggerFqcn</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the fully qualified class name of the caller of the logging API.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getLoggerName()" class="member-name-link">getLoggerName</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the logger name.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/Marker.html" title="class or interface in org.apache.logging.log4j" class="external-link">Marker</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getMarker()" class="member-name-link">getMarker</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the Marker associated with the event.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/message/Message.html" title="class or interface in org.apache.logging.log4j.message" class="external-link">Message</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getMessage()" class="member-name-link">getMessage</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the message associated with the event.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>long</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getNanoTime()" class="member-name-link">getNanoTime</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the value of the running Java Virtual Machine's high-resolution time source when this event was created,
or a dummy value if it is known that this value will not be used downstream.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StackTraceElement.html" title="class or interface in java.lang" class="external-link">StackTraceElement</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getSource()" class="member-name-link">getSource</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the source of logging request.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>long</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getThreadId()" class="member-name-link">getThreadId</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the thread ID.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getThreadName()" class="member-name-link">getThreadName</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the thread name.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getThreadPriority()" class="member-name-link">getThreadPriority</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets the thread priority.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getThrown()" class="member-name-link">getThrown</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets throwable associated with logging request.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="impl/ThrowableProxy.html" title="class in org.apache.logging.log4j.core.impl">ThrowableProxy</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getThrownProxy()" class="member-name-link">getThrownProxy</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets throwable proxy associated with logging request.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getTimeMillis()" class="member-name-link">getTimeMillis</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Gets event time in milliseconds since midnight, January 1, 1970 UTC.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#isEndOfBatch()" class="member-name-link">isEndOfBatch</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns <code>true</code> if this event is the last one in a batch, <code>false</code> otherwise.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#isIncludeLocation()" class="member-name-link">isIncludeLocation</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns whether the source of the logging request is required downstream.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#setEndOfBatch(boolean)" class="member-name-link">setEndOfBatch</a><wbr>(boolean&nbsp;endOfBatch)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sets whether this event is the last one in a batch.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#setIncludeLocation(boolean)" class="member-name-link">setIncludeLocation</a><wbr>(boolean&nbsp;locationRequired)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sets whether the source of the logging request is required downstream.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#toImmutable()" class="member-name-link">toImmutable</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns an immutable version of this log event, which MAY BE a copy of this event.</div>
</div>
</div>
</div>
</div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="toImmutable()">
<h3>toImmutable</h3>
<div class="member-signature"><span class="return-type"><a href="LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a></span>&nbsp;<span class="element-name">toImmutable</span>()</div>
<div class="block">Returns an immutable version of this log event, which MAY BE a copy of this event.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>an immutable version of this log event</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getContextMap()">
<h3>getContextMap</h3>
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
</span><span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">getContextMap</span>()</div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">use <a href="#getContextData()"><code>getContextData()</code></a> instead</div>
</div>
<div class="block">Gets the context map (also know as Mapped Diagnostic Context or MDC).</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>The context map, never <code>null</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getContextData()">
<h3>getContextData</h3>
<div class="member-signature"><span class="return-type"><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/util/ReadOnlyStringMap.html" title="class or interface in org.apache.logging.log4j.util" class="external-link">ReadOnlyStringMap</a></span>&nbsp;<span class="element-name">getContextData</span>()</div>
<div class="block">Returns the <code>ReadOnlyStringMap</code> object holding context data key-value pairs.
<p>
Context data (also known as Mapped Diagnostic Context or MDC) is data that is set by the application to be
included in all subsequent log events. The default source for context data is the <a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/ThreadContext.html" title="class or interface in org.apache.logging.log4j" class="external-link"><code>ThreadContext</code></a> (and
<a href="https://logging.apache.org/log4j/2.x/manual/configuration.html#PropertySubstitution">properties</a>
configured on the Logger that logged the event), but users can configure a custom <a href="ContextDataInjector.html" title="interface in org.apache.logging.log4j.core"><code>ContextDataInjector</code></a>
to inject key-value pairs from any arbitrary source.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the <code>ReadOnlyStringMap</code> object holding context data key-value pairs</dd>
<dt>Since:</dt>
<dd>2.7</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="ContextDataInjector.html" title="interface in org.apache.logging.log4j.core"><code>ContextDataInjector</code></a></li>
<li><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/ThreadContext.html" title="class or interface in org.apache.logging.log4j" class="external-link"><code>ThreadContext</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getContextStack()">
<h3>getContextStack</h3>
<div class="member-signature"><span class="return-type"><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/ThreadContext.ContextStack.html" title="class or interface in org.apache.logging.log4j" class="external-link">ThreadContext.ContextStack</a></span>&nbsp;<span class="element-name">getContextStack</span>()</div>
<div class="block">Gets the context stack (also known as Nested Diagnostic Context or NDC).</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>The context stack, never <code>null</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getLoggerFqcn()">
<h3>getLoggerFqcn</h3>
<div class="member-signature"><span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getLoggerFqcn</span>()</div>
<div class="block">Returns the fully qualified class name of the caller of the logging API.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>The fully qualified class name of the caller.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getLevel()">
<h3>getLevel</h3>
<div class="member-signature"><span class="return-type"><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/Level.html" title="class or interface in org.apache.logging.log4j" class="external-link">Level</a></span>&nbsp;<span class="element-name">getLevel</span>()</div>
<div class="block">Gets the level.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>level.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getLoggerName()">
<h3>getLoggerName</h3>
<div class="member-signature"><span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getLoggerName</span>()</div>
<div class="block">Gets the logger name.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>logger name, may be <code>null</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getMarker()">
<h3>getMarker</h3>
<div class="member-signature"><span class="return-type"><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/Marker.html" title="class or interface in org.apache.logging.log4j" class="external-link">Marker</a></span>&nbsp;<span class="element-name">getMarker</span>()</div>
<div class="block">Gets the Marker associated with the event.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>Marker or <code>null</code> if no Marker was defined on this LogEvent</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getMessage()">
<h3>getMessage</h3>
<div class="member-signature"><span class="return-type"><a href="https://logging.apache.org/log4j/2.x/apidocs/org/apache/logging/log4j/message/Message.html" title="class or interface in org.apache.logging.log4j.message" class="external-link">Message</a></span>&nbsp;<span class="element-name">getMessage</span>()</div>
<div class="block">Gets the message associated with the event.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>message.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTimeMillis()">
<h3>getTimeMillis</h3>
<div class="member-signature"><span class="return-type">long</span>&nbsp;<span class="element-name">getTimeMillis</span>()</div>
<div class="block">Gets event time in milliseconds since midnight, January 1, 1970 UTC.
Use <a href="#getInstant()"><code>getInstant()</code></a> to get higher precision timestamp information if available on this platform.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the milliseconds component of this log event's <a href="#getInstant()">timestamp</a></dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#currentTimeMillis--" title="class or interface in java.lang" class="external-link"><code>System.currentTimeMillis()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getInstant()">
<h3>getInstant</h3>
<div class="member-signature"><span class="return-type"><a href="time/Instant.html" title="interface in org.apache.logging.log4j.core.time">Instant</a></span>&nbsp;<span class="element-name">getInstant</span>()</div>
<div class="block">Returns the Instant when the message was logged.
<p>
<b>Caution</b>: if this <code>LogEvent</code> implementation is mutable and reused for multiple consecutive log messages,
then the <code>Instant</code> object returned by this method is also mutable and reused.
Client code should not keep a reference to the returned object but make a copy instead.
</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the <code>Instant</code> holding Instant details for this log event</dd>
<dt>Since:</dt>
<dd>2.11</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSource()">
<h3>getSource</h3>
<div class="member-signature"><span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StackTraceElement.html" title="class or interface in java.lang" class="external-link">StackTraceElement</a></span>&nbsp;<span class="element-name">getSource</span>()</div>
<div class="block">Gets the source of logging request.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>source of logging request, may be null.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getThreadName()">
<h3>getThreadName</h3>
<div class="member-signature"><span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getThreadName</span>()</div>
<div class="block">Gets the thread name.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>thread name, may be null.
TODO guess this could go into a thread context object too. (RG) Why?</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getThreadId()">
<h3>getThreadId</h3>
<div class="member-signature"><span class="return-type">long</span>&nbsp;<span class="element-name">getThreadId</span>()</div>
<div class="block">Gets the thread ID.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>thread ID.</dd>
<dt>Since:</dt>
<dd>2.6</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getThreadPriority()">
<h3>getThreadPriority</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">getThreadPriority</span>()</div>
<div class="block">Gets the thread priority.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>thread priority.</dd>
<dt>Since:</dt>
<dd>2.6</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getThrown()">
<h3>getThrown</h3>
<div class="member-signature"><span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a></span>&nbsp;<span class="element-name">getThrown</span>()</div>
<div class="block">Gets throwable associated with logging request.
<p>Convenience method for <code>ThrowableProxy.getThrowable();</code></p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>throwable, may be null.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getThrownProxy()">
<h3>getThrownProxy</h3>
<div class="member-signature"><span class="return-type"><a href="impl/ThrowableProxy.html" title="class in org.apache.logging.log4j.core.impl">ThrowableProxy</a></span>&nbsp;<span class="element-name">getThrownProxy</span>()</div>
<div class="block">Gets throwable proxy associated with logging request.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>throwable, may be null.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isEndOfBatch()">
<h3>isEndOfBatch</h3>
<div class="member-signature"><span class="return-type">boolean</span>&nbsp;<span class="element-name">isEndOfBatch</span>()</div>
<div class="block">Returns <code>true</code> if this event is the last one in a batch, <code>false</code> otherwise. Used by asynchronous
Loggers and Appenders to signal to buffered downstream components when to flush to disk, as a more efficient
alternative to the <code>immediateFlush=true</code> configuration.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>whether this event is the last one in a batch.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isIncludeLocation()">
<h3>isIncludeLocation</h3>
<div class="member-signature"><span class="return-type">boolean</span>&nbsp;<span class="element-name">isIncludeLocation</span>()</div>
<div class="block">Returns whether the source of the logging request is required downstream. Asynchronous Loggers and Appenders use
this flag to determine whether to take a <code>StackTrace</code> snapshot or not before handing off this event to
another thread.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd><code>true</code> if the source of the logging request is required downstream, <code>false</code> otherwise.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#getSource()"><code>getSource()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setEndOfBatch(boolean)">
<h3>setEndOfBatch</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">setEndOfBatch</span><wbr><span class="parameters">(boolean&nbsp;endOfBatch)</span></div>
<div class="block">Sets whether this event is the last one in a batch. Used by asynchronous Loggers and Appenders to signal to
buffered downstream components when to flush to disk, as a more efficient alternative to the
<code>immediateFlush=true</code> configuration.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>endOfBatch</code> - <code>true</code> if this event is the last one in a batch, <code>false</code> otherwise.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setIncludeLocation(boolean)">
<h3>setIncludeLocation</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">setIncludeLocation</span><wbr><span class="parameters">(boolean&nbsp;locationRequired)</span></div>
<div class="block">Sets whether the source of the logging request is required downstream. Asynchronous Loggers and Appenders use
this flag to determine whether to take a <code>StackTrace</code> snapshot or not before handing off this event to
another thread.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>locationRequired</code> - <code>true</code> if the source of the logging request is required downstream, <code>false</code>
otherwise.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#getSource()"><code>getSource()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getNanoTime()">
<h3>getNanoTime</h3>
<div class="member-signature"><span class="return-type">long</span>&nbsp;<span class="element-name">getNanoTime</span>()</div>
<div class="block">Returns the value of the running Java Virtual Machine's high-resolution time source when this event was created,
or a dummy value if it is known that this value will not be used downstream.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>The value of the running Java Virtual Machine's high-resolution time source when this event was created.</dd>
<dt>Since:</dt>
<dd>Log4J 2.4</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small><p align="center"> Copyright &copy; 1999-2024 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.<br/> Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation. </p></small></p>
</footer>
</div>
</div>
</body>
</html>