blob: 01bfc4121a490cdde686bae7d3c57d7c5e465649 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>GelfLayout (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.layout, class: GelfLayout">
<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/GelfLayout.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><a href="#nested-class-summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&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><a href="#constructor-detail">Constr</a>&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.layout</a></div>
<h1 title="Class GelfLayout" class="title">Class GelfLayout</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance"><a href="AbstractLayout.html" title="class in org.apache.logging.log4j.core.layout">org.apache.logging.log4j.core.layout.AbstractLayout</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>&gt;
<div class="inheritance"><a href="AbstractStringLayout.html" title="class in org.apache.logging.log4j.core.layout">org.apache.logging.log4j.core.layout.AbstractStringLayout</a>
<div class="inheritance">org.apache.logging.log4j.core.layout.GelfLayout</div>
</div>
</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="../impl/LocationAware.html" title="interface in org.apache.logging.log4j.core.impl">LocationAware</a></code>, <code><a href="../Layout.html" title="interface in org.apache.logging.log4j.core">Layout</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>&gt;</code>, <code><a href="Encoder.html" title="interface in org.apache.logging.log4j.core.layout">Encoder</a>&lt;<a href="../LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a>&gt;</code>, <code><a href="../StringLayout.html" title="interface in org.apache.logging.log4j.core">StringLayout</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="annotations"><a href="../config/plugins/Plugin.html" title="annotation in org.apache.logging.log4j.core.config.plugins">@Plugin</a>(<a href="../config/plugins/Plugin.html#name()">name</a>="GelfLayout",
<a href="../config/plugins/Plugin.html#category()">category</a>="Core",
<a href="../config/plugins/Plugin.html#elementType()">elementType</a>="layout",
<a href="../config/plugins/Plugin.html#printObject()">printObject</a>=true)
</span><span class="modifiers">public final class </span><span class="element-name type-name-label">GelfLayout</span>
<span class="extends-implements">extends <a href="AbstractStringLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractStringLayout</a></span></div>
<div class="block">Lays out events in the Graylog Extended Log Format (GELF) 1.1.
<p>
This layout compresses JSON to GZIP or ZLIB (the <code>compressionType</code>) if
log event data is larger than 1024 bytes (the <code>compressionThreshold</code>).
This layout does not implement chunking.
</p></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="http://docs.graylog.org/en/latest/pages/gelf.html#gelf">GELF specification</a></li>
</ul>
</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<li>
<section class="nested-class-summary" id="nested-class-summary">
<h2>Nested Class Summary</h2>
<div class="caption"><span>Nested Classes</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Class</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static class&nbsp;</code></div>
<div class="col-second even-row-color"><code><a href="GelfLayout.Builder.html" class="type-name-link" title="class in org.apache.logging.log4j.core.layout">GelfLayout.Builder</a>&lt;<a href="GelfLayout.Builder.html" title="type parameter in GelfLayout.Builder">B</a> extends <a href="GelfLayout.Builder.html" title="class in org.apache.logging.log4j.core.layout">GelfLayout.Builder</a>&lt;<a href="GelfLayout.Builder.html" title="type parameter in GelfLayout.Builder">B</a>&gt;&gt;</code></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><code>static enum&nbsp;</code></div>
<div class="col-second odd-row-color"><code><a href="GelfLayout.CompressionType.html" class="type-name-link" title="enum in org.apache.logging.log4j.core.layout">GelfLayout.CompressionType</a></code></div>
<div class="col-last odd-row-color">&nbsp;</div>
</div>
<div class="inherited-list">
<h2 id="nested-classes-inherited-from-class-org.apache.logging.log4j.core.layout.AbstractStringLayout">Nested classes/interfaces inherited from class&nbsp;org.apache.logging.log4j.core.layout.<a href="AbstractStringLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractStringLayout</a></h2>
<code><a href="AbstractStringLayout.Serializer.html" title="interface in org.apache.logging.log4j.core.layout">AbstractStringLayout.Serializer</a>, <a href="AbstractStringLayout.Serializer2.html" title="interface in org.apache.logging.log4j.core.layout">AbstractStringLayout.Serializer2</a></code></div>
</section>
</li>
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="inherited-list">
<h3 id="fields-inherited-from-class-org.apache.logging.log4j.core.layout.AbstractStringLayout">Fields inherited from class&nbsp;org.apache.logging.log4j.core.layout.<a href="AbstractStringLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractStringLayout</a></h3>
<code><a href="AbstractStringLayout.html#DEFAULT_STRING_BUILDER_SIZE">DEFAULT_STRING_BUILDER_SIZE</a>, <a href="AbstractStringLayout.html#MAX_STRING_BUILDER_SIZE">MAX_STRING_BUILDER_SIZE</a></code></div>
<div class="inherited-list">
<h3 id="fields-inherited-from-class-org.apache.logging.log4j.core.layout.AbstractLayout">Fields inherited from class&nbsp;org.apache.logging.log4j.core.layout.<a href="AbstractLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractLayout</a></h3>
<code><a href="AbstractLayout.html#configuration">configuration</a>, <a href="AbstractLayout.html#eventCount">eventCount</a>, <a href="AbstractLayout.html#footer">footer</a>, <a href="AbstractLayout.html#header">header</a>, <a href="AbstractLayout.html#LOGGER">LOGGER</a></code></div>
<div class="inherited-list">
<h3 id="fields-inherited-from-class-org.apache.logging.log4j.core.Layout">Fields inherited from interface&nbsp;org.apache.logging.log4j.core.<a href="../Layout.html" title="interface in org.apache.logging.log4j.core">Layout</a></h3>
<code><a href="../Layout.html#ELEMENT_TYPE">ELEMENT_TYPE</a></code></div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.String,org.apache.logging.log4j.core.util.KeyValuePair%5B%5D,org.apache.logging.log4j.core.layout.GelfLayout.CompressionType,int,boolean)" class="member-name-link">GelfLayout</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>&nbsp;host,
<a href="../util/KeyValuePair.html" title="class in org.apache.logging.log4j.core.util">KeyValuePair</a>[]&nbsp;additionalFields,
<a href="GelfLayout.CompressionType.html" title="enum in org.apache.logging.log4j.core.layout">GelfLayout.CompressionType</a>&nbsp;compressionType,
int&nbsp;compressionThreshold,
boolean&nbsp;includeStacktrace)</code></div>
<div class="col-last even-row-color">
<div class="block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">Use <a href="#newBuilder()"><code>newBuilder()</code></a> instead</div>
</div>
</div>
</div>
</section>
</li>
<!-- ========== 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-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static 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-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete 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-tab1 method-summary-table-tab4 method-summary-table-tab6"><code>static <a href="GelfLayout.html" title="class in org.apache.logging.log4j.core.layout">GelfLayout</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#createLayout(java.lang.String,org.apache.logging.log4j.core.util.KeyValuePair%5B%5D,org.apache.logging.log4j.core.layout.GelfLayout.CompressionType,int,boolean)" class="member-name-link">createLayout</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>&nbsp;host,
<a href="../util/KeyValuePair.html" title="class in org.apache.logging.log4j.core.util">KeyValuePair</a>[]&nbsp;additionalFields,
<a href="GelfLayout.CompressionType.html" title="enum in org.apache.logging.log4j.core.layout">GelfLayout.CompressionType</a>&nbsp;compressionType,
int&nbsp;compressionThreshold,
boolean&nbsp;includeStacktrace)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6">
<div class="block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">Use <a href="#newBuilder()"><code>newBuilder()</code></a> instead</div>
</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#encode(org.apache.logging.log4j.core.LogEvent,org.apache.logging.log4j.core.layout.ByteBufferDestination)" class="member-name-link">encode</a><wbr>(<a href="../LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a>&nbsp;event,
<a href="ByteBufferDestination.html" title="interface in org.apache.logging.log4j.core.layout">ByteBufferDestination</a>&nbsp;destination)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Encodes the specified source LogEvent to some binary representation and writes the result to the specified
destination.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getContentFormat()" class="member-name-link">getContentFormat</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a description of the content format.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><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-tab4"><code><a href="#getContentType()" class="member-name-link">getContentType</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the content type output by this layout.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;B extends <a href="GelfLayout.Builder.html" title="class in org.apache.logging.log4j.core.layout">GelfLayout.Builder</a>&lt;B&gt;&gt;<br>B</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newBuilder()" class="member-name-link">newBuilder</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#requiresLocation()" class="member-name-link">requiresLocation</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toByteArray(org.apache.logging.log4j.core.LogEvent)" class="member-name-link">toByteArray</a><wbr>(<a href="../LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a>&nbsp;event)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Formats the Log Event as a byte array.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><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-tab4"><code><a href="#toSerializable(org.apache.logging.log4j.core.LogEvent)" class="member-name-link">toSerializable</a><wbr>(<a href="../LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a>&nbsp;event)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Formats the event as an Object that can be serialized.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><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-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-org.apache.logging.log4j.core.layout.AbstractStringLayout">Methods inherited from class&nbsp;org.apache.logging.log4j.core.layout.<a href="AbstractStringLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractStringLayout</a></h3>
<code><a href="AbstractStringLayout.html#getBytes(java.lang.String)">getBytes</a>, <a href="AbstractStringLayout.html#getCharset()">getCharset</a>, <a href="AbstractStringLayout.html#getFooter()">getFooter</a>, <a href="AbstractStringLayout.html#getFooterSerializer()">getFooterSerializer</a>, <a href="AbstractStringLayout.html#getHeader()">getHeader</a>, <a href="AbstractStringLayout.html#getHeaderSerializer()">getHeaderSerializer</a>, <a href="AbstractStringLayout.html#getStringBuilder()">getStringBuilder</a>, <a href="AbstractStringLayout.html#getStringBuilderEncoder()">getStringBuilderEncoder</a>, <a href="AbstractStringLayout.html#serializeToBytes(org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer,byte%5B%5D)">serializeToBytes</a>, <a href="AbstractStringLayout.html#serializeToString(org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer)">serializeToString</a>, <a href="AbstractStringLayout.html#trimToMaxSize(java.lang.StringBuilder)">trimToMaxSize</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-org.apache.logging.log4j.core.layout.AbstractLayout">Methods inherited from class&nbsp;org.apache.logging.log4j.core.layout.<a href="AbstractLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractLayout</a></h3>
<code><a href="AbstractLayout.html#getConfiguration()">getConfiguration</a>, <a href="AbstractLayout.html#markEvent()">markEvent</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(java.lang.String,org.apache.logging.log4j.core.util.KeyValuePair[],org.apache.logging.log4j.core.layout.GelfLayout.CompressionType,int,boolean)">
<h3>GelfLayout</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="modifiers">public</span>&nbsp;<span class="element-name">GelfLayout</span><wbr><span class="parameters">(<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>&nbsp;host,
<a href="../util/KeyValuePair.html" title="class in org.apache.logging.log4j.core.util">KeyValuePair</a>[]&nbsp;additionalFields,
<a href="GelfLayout.CompressionType.html" title="enum in org.apache.logging.log4j.core.layout">GelfLayout.CompressionType</a>&nbsp;compressionType,
int&nbsp;compressionThreshold,
boolean&nbsp;includeStacktrace)</span></div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">Use <a href="#newBuilder()"><code>newBuilder()</code></a> instead</div>
</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="toString()">
<h3>toString</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<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">toString</span>()</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--" title="class or interface in java.lang" class="external-link">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createLayout(java.lang.String,org.apache.logging.log4j.core.util.KeyValuePair[],org.apache.logging.log4j.core.layout.GelfLayout.CompressionType,int,boolean)">
<h3>createLayout</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="modifiers">public static</span>&nbsp;<span class="return-type"><a href="GelfLayout.html" title="class in org.apache.logging.log4j.core.layout">GelfLayout</a></span>&nbsp;<span class="element-name">createLayout</span><wbr><span class="parameters">(<a href="../config/plugins/PluginAttribute.html" title="annotation in org.apache.logging.log4j.core.config.plugins">@PluginAttribute</a>("host")
<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>&nbsp;host,
<a href="../config/plugins/PluginElement.html" title="annotation in org.apache.logging.log4j.core.config.plugins">@PluginElement</a>("AdditionalField")
<a href="../util/KeyValuePair.html" title="class in org.apache.logging.log4j.core.util">KeyValuePair</a>[]&nbsp;additionalFields,
<a href="../config/plugins/PluginAttribute.html" title="annotation in org.apache.logging.log4j.core.config.plugins">@PluginAttribute</a>(<a href="../config/plugins/PluginAttribute.html#value()">value</a>="compressionType",<a href="../config/plugins/PluginAttribute.html#defaultString()">defaultString</a>="GZIP")
<a href="GelfLayout.CompressionType.html" title="enum in org.apache.logging.log4j.core.layout">GelfLayout.CompressionType</a>&nbsp;compressionType,
<a href="../config/plugins/PluginAttribute.html" title="annotation in org.apache.logging.log4j.core.config.plugins">@PluginAttribute</a>(<a href="../config/plugins/PluginAttribute.html#value()">value</a>="compressionThreshold",<a href="../config/plugins/PluginAttribute.html#defaultInt()">defaultInt</a>=1024)
int&nbsp;compressionThreshold,
<a href="../config/plugins/PluginAttribute.html" title="annotation in org.apache.logging.log4j.core.config.plugins">@PluginAttribute</a>(<a href="../config/plugins/PluginAttribute.html#value()">value</a>="includeStacktrace",<a href="../config/plugins/PluginAttribute.html#defaultBoolean()">defaultBoolean</a>=true)
boolean&nbsp;includeStacktrace)</span></div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">Use <a href="#newBuilder()"><code>newBuilder()</code></a> instead</div>
</div>
</section>
</li>
<li>
<section class="detail" id="newBuilder()">
<h3>newBuilder</h3>
<div class="member-signature"><span class="annotations"><a href="../config/plugins/PluginBuilderFactory.html" title="annotation in org.apache.logging.log4j.core.config.plugins">@PluginBuilderFactory</a>
</span><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;B extends <a href="GelfLayout.Builder.html" title="class in org.apache.logging.log4j.core.layout">GelfLayout.Builder</a>&lt;B&gt;&gt;</span>&nbsp;<span class="return-type">B</span>&nbsp;<span class="element-name">newBuilder</span>()</div>
</section>
</li>
<li>
<section class="detail" id="getContentFormat()">
<h3>getContentFormat</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<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">getContentFormat</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../Layout.html#getContentFormat()">Layout</a></code></span></div>
<div class="block">Returns a description of the content format.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../Layout.html#getContentFormat()">getContentFormat</a></code>&nbsp;in interface&nbsp;<code><a href="../Layout.html" title="interface in org.apache.logging.log4j.core">Layout</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>&gt;</code></dd>
<dt>Overrides:</dt>
<dd><code><a href="AbstractLayout.html#getContentFormat()">getContentFormat</a></code>&nbsp;in class&nbsp;<code><a href="AbstractLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractLayout</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>&gt;</code></dd>
<dt>Returns:</dt>
<dd>a Map of key/value pairs describing the Layout-specific content format, or an empty Map if no content
format descriptors are specified.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getContentType()">
<h3>getContentType</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<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">getContentType</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../Layout.html#getContentType()">Layout</a></code></span></div>
<div class="block">Returns the content type output by this layout. The base class returns "text/plain".</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../Layout.html#getContentType()">getContentType</a></code>&nbsp;in interface&nbsp;<code><a href="../Layout.html" title="interface in org.apache.logging.log4j.core">Layout</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>&gt;</code></dd>
<dt>Overrides:</dt>
<dd><code><a href="AbstractStringLayout.html#getContentType()">getContentType</a></code>&nbsp;in class&nbsp;<code><a href="AbstractStringLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractStringLayout</a></code></dd>
<dt>Returns:</dt>
<dd>The default content type for Strings.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toByteArray(org.apache.logging.log4j.core.LogEvent)">
<h3>toByteArray</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">toByteArray</span><wbr><span class="parameters">(<a href="../LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a>&nbsp;event)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from class:&nbsp;<code><a href="AbstractStringLayout.html#toByteArray(org.apache.logging.log4j.core.LogEvent)">AbstractStringLayout</a></code></span></div>
<div class="block">Formats the Log Event as a byte array.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../Layout.html#toByteArray(org.apache.logging.log4j.core.LogEvent)">toByteArray</a></code>&nbsp;in interface&nbsp;<code><a href="../Layout.html" title="interface in org.apache.logging.log4j.core">Layout</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>&gt;</code></dd>
<dt>Overrides:</dt>
<dd><code><a href="AbstractStringLayout.html#toByteArray(org.apache.logging.log4j.core.LogEvent)">toByteArray</a></code>&nbsp;in class&nbsp;<code><a href="AbstractStringLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractStringLayout</a></code></dd>
<dt>Parameters:</dt>
<dd><code>event</code> - The Log Event.</dd>
<dt>Returns:</dt>
<dd>The formatted event as a byte array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="encode(org.apache.logging.log4j.core.LogEvent,org.apache.logging.log4j.core.layout.ByteBufferDestination)">
<h3>encode</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">encode</span><wbr><span class="parameters">(<a href="../LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a>&nbsp;event,
<a href="ByteBufferDestination.html" title="interface in org.apache.logging.log4j.core.layout">ByteBufferDestination</a>&nbsp;destination)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from class:&nbsp;<code><a href="AbstractLayout.html#encode(org.apache.logging.log4j.core.LogEvent,org.apache.logging.log4j.core.layout.ByteBufferDestination)">AbstractLayout</a></code></span></div>
<div class="block">Encodes the specified source LogEvent to some binary representation and writes the result to the specified
destination.
<p>
The default implementation of this method delegates to the <a href="../Layout.html#toByteArray(org.apache.logging.log4j.core.LogEvent)"><code>Layout.toByteArray(LogEvent)</code></a> method which allocates
temporary objects.
</p><p>
Subclasses can override this method to provide a garbage-free implementation. For text-based layouts,
<code>AbstractStringLayout</code> provides various convenience methods to help with this:
</p>
<pre> &#64;Plugin(name = "MyLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = true)
public final class MyLayout extends AbstractStringLayout {
&#64;Override
public void encode(LogEvent event, ByteBufferDestination destination) {
StringBuilder text = getStringBuilder();
convertLogEventToText(event, text);
getStringBuilderEncoder().encode(text, destination);
}
private void convertLogEventToText(LogEvent event, StringBuilder destination) {
... // append a text representation of the log event to the StringBuilder
}
}
</pre></div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="Encoder.html#encode(T,org.apache.logging.log4j.core.layout.ByteBufferDestination)">encode</a></code>&nbsp;in interface&nbsp;<code><a href="Encoder.html" title="interface in org.apache.logging.log4j.core.layout">Encoder</a>&lt;<a href="../LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a>&gt;</code></dd>
<dt>Overrides:</dt>
<dd><code><a href="AbstractLayout.html#encode(org.apache.logging.log4j.core.LogEvent,org.apache.logging.log4j.core.layout.ByteBufferDestination)">encode</a></code>&nbsp;in class&nbsp;<code><a href="AbstractLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractLayout</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>&gt;</code></dd>
<dt>Parameters:</dt>
<dd><code>event</code> - the LogEvent to encode.</dd>
<dd><code>destination</code> - holds the ByteBuffer to write into.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="AbstractStringLayout.html#getStringBuilder()"><code>AbstractStringLayout.getStringBuilder()</code></a></li>
<li><a href="AbstractStringLayout.html#getStringBuilderEncoder()"><code>AbstractStringLayout.getStringBuilderEncoder()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="requiresLocation()">
<h3>requiresLocation</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">requiresLocation</span>()</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../impl/LocationAware.html#requiresLocation()">requiresLocation</a></code>&nbsp;in interface&nbsp;<code><a href="../impl/LocationAware.html" title="interface in org.apache.logging.log4j.core.impl">LocationAware</a></code></dd>
<dt>Overrides:</dt>
<dd><code><a href="AbstractStringLayout.html#requiresLocation()">requiresLocation</a></code>&nbsp;in class&nbsp;<code><a href="AbstractStringLayout.html" title="class in org.apache.logging.log4j.core.layout">AbstractStringLayout</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toSerializable(org.apache.logging.log4j.core.LogEvent)">
<h3>toSerializable</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<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">toSerializable</span><wbr><span class="parameters">(<a href="../LogEvent.html" title="interface in org.apache.logging.log4j.core">LogEvent</a>&nbsp;event)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../Layout.html#toSerializable(org.apache.logging.log4j.core.LogEvent)">Layout</a></code></span></div>
<div class="block">Formats the event as an Object that can be serialized.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>event</code> - The Logging Event.</dd>
<dt>Returns:</dt>
<dd>The formatted event.</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>