This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch main-site-stg-out
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/main-site-stg-out by this push:
     new 0548233e73 Add website content generated from 
`9c1884281f045c33892d44ebd3fce0cd8991ba51`
0548233e73 is described below

commit 0548233e73808eff9d4f8af1e5d0de72e4469bd6
Author: ASF Logging Services RM <[email protected]>
AuthorDate: Fri Jul 5 14:21:20 2024 +0000

    Add website content generated from 
`9c1884281f045c33892d44ebd3fce0cd8991ba51`
---
 manual/garbagefree.html   |  5 +--
 migrate-from-logback.html | 83 ++++++++++++++++++++++++++++++++++++++++
 release-notes.html        | 10 -----
 sitemap.xml               | 96 +++++++++++++++++++++++------------------------
 4 files changed, 133 insertions(+), 61 deletions(-)

diff --git a/manual/garbagefree.html b/manual/garbagefree.html
index 3707c8d6af..fb14504b72 100644
--- a/manual/garbagefree.html
+++ b/manual/garbagefree.html
@@ -1101,10 +1101,9 @@ If pool runs out of capacity (see <a 
href="#log4j.recycler.capacity"><code>log4j
 </div>
 <div id="core-limitation-properties" class="dlist">
 <dl>
-<dt class="hdlist1"><code>&lt;Properties&gt;</code> section</dt>
+<dt class="hdlist1">Property substitutions</dt>
 <dd>
-<p>A configuration containing <a 
href="configuration.html#property-substitution" class="xref page">a 
<code>&lt;Properties&gt;</code> section</a> will result in temporary
-objects being created during steady-state logging.</p>
+<p>Some <a href="configuration.html#PropertySubstitution" class="xref 
page">property substitutions</a> (e.g., ones using <a 
href="lookups.html#DateLookup" class="xref page">Date Lookup</a>) might result 
in temporary objects being created during steady-state logging.</p>
 </dd>
 </dl>
 </div>
diff --git a/migrate-from-logback.html b/migrate-from-logback.html
index 589abdc7b8..ce2d8b225e 100644
--- a/migrate-from-logback.html
+++ b/migrate-from-logback.html
@@ -473,6 +473,89 @@ To assist with migrating Logback configuration components 
to Log4j Core, see the
 <p>For the complete list of all Log4j configuration knobs, see <a 
href="manual/configuration.html" class="xref page">the Configuration 
page</a>.</p>
 </div>
 </div>
+<div class="sect2">
+<h3 id="parameterized-logging"><a class="anchor" 
href="#parameterized-logging"></a>Parameterized logging</h3>
+<div class="paragraph">
+<p>A common mistake in parameterized logging is to add a <code>{}</code> 
placeholder for the exception associated with a log event:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-java hljs" 
data-lang="java">} catch (Exception exception) {
+    logger.error("The foo process exited with an error: {}", exception);
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Log4j Core and Logback differ in the way they treat this statement:</p>
+</div>
+<div class="dlist">
+<dl>
+<dt class="hdlist1">Logback</dt>
+<dd>
+<p>Logback interprets the <code>exception</code> argument as throwable and 
removes it from the list of parameters.
+We end up with a parameterized statement with one placeholder, but zero 
parameters.
+The placeholder therefore remains as is:</p>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-none hljs">The foo 
process exited with and error: {}
+java.lang.RuntimeException: Message
+    at example.MigrateFromLogback.doLogWrong(MigrateFromLogback.java:10)
+...</code></pre>
+</div>
+</div>
+</dd>
+<dt class="hdlist1">Log4j Core</dt>
+<dd>
+<p>Log4j Core first looks for the parameters of the message.
+Since the format string has one placeholder, the <code>exception</code> 
argument is interpreted as a parameter of the log message.
+The throwable associated to the log event is <code>null</code>, which results 
in a missing stack trace:</p>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-none hljs">The foo 
process exited with and error: java.lang.RuntimeException: Message</code></pre>
+</div>
+</div>
+</dd>
+</dl>
+</div>
+<div class="paragraph">
+<p>To fix this problem and get the same output in both backends, you should 
remove the placeholder from the format string:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-java hljs" 
data-lang="java">} catch (Exception exception) {
+    logger.error("The foo process exited with an error.", exception);
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>After the change, the output will look us:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-none hljs">The foo 
process exited with and error.
+java.lang.RuntimeException: Message
+    at example.MigrateFromLogback.doLogWrong(MigrateFromLogback.java:10)
+...</code></pre>
+</div>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>As a temporary solution, the SLF4J-to-Log4j API bridges contain a special
+<a href="manual/api.html#logger-message-factories" class="xref 
page"><code>MessageFactory</code></a>
+that classifies trailing <code>Throwable</code> arguments in the same way 
Logback does.
+To use it, you need to set the <a 
href="manual/systemproperties.html#log4j2.messageFactory" class="xref 
page"><code>log4j2.messageFactory</code></a> configuration property to 
<code>org.apache.logging.slf4j.message.ThrowableConsumingMessageFactory</code>.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+</div>
 </div>
 </div>
 </article>
diff --git a/release-notes.html b/release-notes.html
index b9f6d117c2..d449c7836e 100644
--- a/release-notes.html
+++ b/release-notes.html
@@ -293,16 +293,6 @@
 </div>
 </div>
 <div class="sect2">
-<h3 id="release-notes-3-x-x-changed"><a class="anchor" 
href="#release-notes-3-x-x-changed"></a>Changed</h3>
-<div class="ulist">
-<ul>
-<li>
-<p>Remove <code>log4j-kubernetes</code> lookup. User should migrate to <a 
href="https://github.com/fabric8io/kubernetes-client/blob/main/doc/KubernetesLog4j.md";><code>kubernetes-log4j</code></a>
 (<a href="https://github.com/apache/logging-log4j2/pull/2408";>2408</a>)</p>
-</li>
-</ul>
-</div>
-</div>
-<div class="sect2">
 <h3 id="release-notes-3-x-x-fixed"><a class="anchor" 
href="#release-notes-3-x-x-fixed"></a>Fixed</h3>
 <div class="ulist">
 <ul>
diff --git a/sitemap.xml b/sitemap.xml
index 8016b115fb..4626fa0926 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -2,194 +2,194 @@
 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9";>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/articles.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/development.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/download.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/faq.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/hibernate.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/index.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/javadoc.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/log4j-docker.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/log4j-flume-ng.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/log4j-jpl.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/log4j-jul.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/log4j-slf4j-impl.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/log4j-slf4j2-impl.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 
<loc>https://logging.apache.org/log4j/3.x/log4j-spring-cloud-config-client.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/log4j-to-jul.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/log4j-to-slf4j.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/api.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/appenders.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/architecture.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/async.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/cloud.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/config-intro.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/configuration.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/customconfig.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/dependencyinjection.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/extending.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/filters.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/garbagefree.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/getting-started.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/index.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/installation.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/jmx.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 
<loc>https://logging.apache.org/log4j/3.x/manual/json-template-layout.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/layouts.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/logsep.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/lookups.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/migration.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/pattern-layout.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/performance.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/plugins.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/scripts.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/systemproperties.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/manual/usage.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/migrate-from-logback.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/migrate-from-slf4j.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/plugin-reference.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/release-notes.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 <url>
 <loc>https://logging.apache.org/log4j/3.x/thanks.html</loc>
-<lastmod>2024-07-04T09:56:30.296Z</lastmod>
+<lastmod>2024-07-05T14:20:25.662Z</lastmod>
 </url>
 </urlset>

Reply via email to