Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
ceki committed Aug 10, 2021
1 parent 854d6fb commit c1c8d21
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions slf4j-site/src/site/pages/manual.html
Expand Up @@ -168,12 +168,13 @@ <h3 class="doAnchor" name="fluent">Fluent Logging API</h3>
and to log once the event is fully built. The
<code>atTrace()</code>, <code>atDebug()</code>,
<code>atInfo()</code>, <code>atWarn()</code> and
<code>atError()</code> methods new in the
<code>org.slf4j.Logger</code> interface return an instance of
<a href="apidocs/org/slf4j/spi/LoggingEventBuilder.html"><code>LoggingEventBuilder</code></a>.
For disabled log levels, the
returned <code>LoggingEventBuilder</code> instance does nothing,
thus preserving the nano-second level performance of the traditional
<code>atError()</code> methods, all new in the
<code>org.slf4j.Logger</code> interface, return an instance of
<a
href="apidocs/org/slf4j/spi/LoggingEventBuilder.html"><code>LoggingEventBuilder</code></a>.
For disabled log levels, the returned
<code>LoggingEventBuilder</code> instance does nothing, thus
preserving the nano-second level performance of the traditional
logging interface.</p>


Expand All @@ -186,8 +187,10 @@ <h3 class="doAnchor" name="fluent">Fluent Logging API</h3>

<pre class="prettyprint source">logger.info("Hello world.");</pre>

<p>The following statements are all equivalent:</p>


<p>The following log statements are equivalent in their output
(for the default implementation):</p>

<pre class="prettyprint source">
int newT = 15;
int oldT = 16;
Expand All @@ -210,7 +213,7 @@ <h3 class="doAnchor" name="fluent">Fluent Logging API</h3>
</pre>

<p>The fluent logging API allows the specification of many
different type of data to a <code>org.slf4j.Logger</code>
different types of data to a <code>org.slf4j.Logger</code>
without a combinatorial explosion in the number of methods in
the <code>Logger</code> interface.</p>

Expand All @@ -235,6 +238,13 @@ <h3 class="doAnchor" name="fluent">Fluent Logging API</h3>
logger.atDebug().<b>addKeyValue("oldT", oldT)</b>.addKeyValue("newT", newT).log("Temperature changed.");
</pre>

<p>The key-value pair variant of the API stores the key-value
pairs as separates objects. The default implementation as
shipping in the <code>org.slf4j.Logger</code> class
<em>prefixes</em> key-value pairs to the message. Logging
backends are free to customize the output as they see fit.</p>


<h3 class="doAnchor" name="swapping">Binding with a logging
framework at deployment time</h3>

Expand Down

0 comments on commit c1c8d21

Please sign in to comment.