Skip to content

Commit

Permalink
Automatic Site Publish by Buildbot
Browse files Browse the repository at this point in the history
  • Loading branch information
buildbot committed Dec 2, 2023
1 parent 1f4bb6f commit 020fe51
Show file tree
Hide file tree
Showing 3 changed files with 402 additions and 1 deletion.
296 changes: 296 additions & 0 deletions content/blog/2023/12/02/apache-common-logging-1.3.0.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Apache Logging Services</title>

<link href="/css/asciidoctor-default.css" rel="stylesheet" type="text/css" />
<link href="/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="/css/site.css?version=20231118" rel="stylesheet" type="text/css" />

<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/site.js"></script>
<link rel="alternate" type="application/rss+xml" title="ASF Loggin Services" href="/feed.xml">
</head>


<body>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/">Apache Logging Services&trade;</a>
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/guidelines.html">Guidelines</a></li>
<li><a href="/charter.html">Charter</a></li>
<li><a href="/team-list.html">Team</a></li>
<li><a href="/support.html">Support &amp; Help</a></li>
<li><a href="/processes.html">Retirement Processes</a>
<li><a target="_blank" href="https://cwiki.apache.org/confluence/display/LOGGING/Home">Wiki</a>
<li><a href="/what-is-logging.html">What is logging?</a>
</li>
</ul>
</li>
</ul>
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Projects<b class="caret"></b></a>
<ul class="dropdown-menu">


<li><a href="/log4j">Apache Log4j®</a></li>



<li><a href="/log4j/kotlin">Apache Log4j® Kotlin</a></li>



<li><a href="/log4j/scala">Apache Log4j® Scala</a></li>



<li><a href="/log4cxx">Apache log4cxx</a></li>



<li><a href="/chainsaw">Apache Chainsaw</a></li>



<li><a href="/log4j-audit/latest">Apache Log4j® Audit</a></li>



<li><a href="https://flume.apache.org">Apache Flume</a></li>



<li><a href="/log4net">Apache Log4Net</a></li>








</ul>
</li>
</ul>
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dormant<b class="caret"></b></a>
<ul class="dropdown-menu">


















<li><a href="/log4j/1.x">Apache Log4j® 1</a></li>



<li><a href="/log4j/extras">Apache Log4j® 1 Extras</a></li>



<li><a href="/log4php">Apache log4php</a></li>


</ul>
</li>
</ul>
<ul class="nav">
<li><a href="/blog">Blog</a></li>
</ul>
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Security<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/security/">Handling Security</a></li>
<li><a href="/security/known-vulnerabilities.html">Known Vulnerabilities</a></li>
<li><a href="/activity-monitor/">Activity Monitor</a></li>
</ul>
</li>
</ul>

<ul class="nav pull-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a target="_blank" href="https://www.apache.org/">Home</a></li>
<li><a target="_blank" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li><a target="_blank" href="https://www.apache.org/licenses/">License</a></li>
<li><a target="_blank" href="https://www.apache.org/foundation/thanks.html">Thanks</a></li>
<li><a target="_blank" href="https://www.apache.org/events/current-event.html">Current Events</a></li>
<li><a target="_blank" href="https://www.apache.org/security/">Security</a></li>
<li><a target="_blank" href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>


<div class="container">
<div class="content">
<div class="hero-unit">


<h1>Upgrade to Apache Commons Logging 1.3.0</h1>
<p>Instructions to upgrade application to Apache Commons Logging 1.3.0.</p>
</div>
<time itemprop="datePublished" datetime="2023-12-02">
02 Dec 2023
</time>

<div itemprop="text"><h1 id="apache-commons-logging">Apache Commons Logging</h1>

<p><a href="https://commons.apache.org/proper/commons-logging/">Apache Commons Logging</a> (JCL) is one of the oldest Java logging API
available.
Released for the first time in 2002, it immediately saw a widespread adoption in the Java community.</p>

<p>While newer APIs, like SLF4J and our own Log4j API, appeared over time, even in 2023 it is hard to find an application stack
that does not depend on JCL.
According to Sonatype, Apache Commons Logging is used in <a href="https://central.sonatype.com/artifact/commons-logging/commons-logging">over 1 million artifacts</a>,
while the second place is taken by SLF4J with <a href="https://central.sonatype.com/artifact/org.slf4j/slf4j-api">almost 40 thousand artifacts</a>.</p>

<h2 id="version-130">Version 1.3.0</h2>

<p>After more than 9 years since its previous release (version 1.2 released in July 2014), Apache Commons Logging released
a new 1.3.0 version today (cf. <a href="https://lists.apache.org/thread/wx6v7wwhbnk64nx708hszctzv8fdsvdl">announcement</a>).
Among the most prominent changes, the new version:</p>

<ul>
<li>forwards logging to the Log4j API out-of-the-box (if present),</li>
<li>also supports forwarding to SLF4J,</li>
<li>adds support for the Java Platform Module System (JPMS) with the module name <code class="language-plaintext highlighter-rouge">org.apache.commons.logging</code>.</li>
</ul>

<h2 id="upgrade-instructions-log4j-corelogback">Upgrade instructions (Log4j Core/Logback)</h2>

<p>The upgrade path for users of the Log4j Core and Logback logging backends is easy.
The first step is upgrading <code class="language-plaintext highlighter-rouge">commons-logging</code>.
In Maven this can be done using dependency management.</p>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;dependencyManagement&gt;</span>
<span class="nt">&lt;dependencies&gt;</span>
<span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>commons-logging<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>commons-logging<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>1.3.0<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
<span class="nt">&lt;/dependencies&gt;</span>
<span class="nt">&lt;/dependencyManagement&gt;</span>
</code></pre></div></div>

<p>The second step consists in removing obsolete dependencies.
Since version 1.2 only supported old generation logging backends out-of-the-box (<a href="https//logging.apache.org/log4j/1.2/">Log4j 1.x</a>,
<a href="https//avalon.apache.org">Avalon</a> and <a href="https://javalogging.sourceforge.net">Lumberjack</a>), the Java community developed
many <code class="language-plaintext highlighter-rouge">LogFactory</code> implementations and complete Apache Commons Logging replacements:</p>

<ul>
<li><a href="https://mvnrepository.com/artifact/org.slf4j/jcl-over-slf4j"><code class="language-plaintext highlighter-rouge">org.slf4j:jcl-over-slf4j</code></a> (replacement),</li>
<li><a href="https://mvnrepository.com/artifact/org.springframework/spring-jcl"><code class="language-plaintext highlighter-rouge">org.springframework:spring-jcl</code></a> (replacement),</li>
<li>our own <a href="https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-jcl"><code class="language-plaintext highlighter-rouge">org.apache.logging.log4j:log4j-jcl</code></a>
(<code class="language-plaintext highlighter-rouge">LogFactory</code> implementation).</li>
</ul>

<p>These artifacts can be <strong>safely</strong> removed from your dependency stack.
For JPMS users this operation is even <strong>required</strong>.</p>

<p>To do so Maven users can use exclusions:</p>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-jcl<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;exclusions&gt;</span>
<span class="nt">&lt;exclusion&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.springframework<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>spring-jcl<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;/exclusion&gt;</span>
<span class="nt">&lt;/exclusions&gt;</span>
<span class="nt">&lt;/dependency&gt;</span>
</code></pre></div></div>

<p>and to prevent regressions, add those dependencies to a <a href="https://maven.apache.org/enforcer/enforcer-rules/bannedDependencies.html"><code class="language-plaintext highlighter-rouge">bannedDependencies</code> Maven Enforcer rule</a>.</p>

<h2 id="upgrade-instructions-log4j-1xreload4j-users">Upgrade instructions (Log4j 1.x/Reload4j users)</h2>

<p>For users that use Log4j 1.x or Reload4j as logging backend the upgrade is more complicated: version 1.3.0 disabled the Log4j 1.x backend by default.</p>

<p>Log4j 1.x/Reload4j users are:</p>

<ul>
<li>encouraged to migrate to Log4j 2.x Core (cf. <a href="https://logging.apache.org/log4j/2.x/manual/migration.html">migration guide</a>) or Logback,</li>
<li>if that is not possible (or if a transitional period is required) they need to add a <code class="language-plaintext highlighter-rouge">commons-logging.properties</code> file to their applications containing:</li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>org.apache.commons.logging.Log = org.apache.commons.logging.impl.Log4JLogger
</code></pre></div></div>

<h2 id="jpms-users">JPMS users</h2>

<p>The <code class="language-plaintext highlighter-rouge">org.apache.commons.logging</code> JPMS module has an <strong>optional</strong> dependency on the Log4j API.
In order for the JVM to automatically add the <code class="language-plaintext highlighter-rouge">org.apache.logging.log4j</code> module to your application’s runtime, you need to add:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>requires org.apache.logging.log4j;
</code></pre></div></div>

<p>to your application’s module descriptor.</p>

</div>
</div>
</div>

<div class="footer">
<div class="container">
<p>
Copyright © 2017-2023 <a href="https://www.apache.org" target="external">The Apache Software Foundation</a>.
Licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0"
target="external">Apache Software License, Version 2.0</a> Please read our <a href="https://privacy.apache.org/policies/privacy-policy-public.html">privacy policy</a>.
</p><p>
Apache, Chainsaw, log4cxx, Log4j, Log4net, log4php and the Apache
feather logo are trademarks or registered trademarks of The Apache
Software Foundation.
Oracle and Java are registered trademarks
of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
</p>
</div>
</div>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.apache.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '42']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="https://analytics.apache.org/matomo.php?idsite=42&amp;rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
</body>
</html>
12 changes: 12 additions & 0 deletions content/blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ <h1>Apache Logging Services Blog</h1>

<ul class="post-list">

<li>
<div class="post-date">02 Dec 2023</div>
<div class="post-title"><a href="/blog/2023/12/02/apache-common-logging-1.3.0.html">Upgrade to Apache Commons Logging 1.3.0</a></div>
<div class="post-tags">
<span class="post-tag">#Apache</span>

<span class="post-tag">#Commmons Logging</span>

<span class="post-tag">#Open Source</span>
</div>
</li>

<li>
<div class="post-date">28 Nov 2023</div>
<div class="post-title"><a href="/blog/2023/11/28/new-pmc-member.html">Welcoming Stephen Webb to the Apache Logging Services PMC</a></div>
Expand Down
Loading

0 comments on commit 020fe51

Please sign in to comment.