blob: becd9993ec5d444f99849f2dae82adf6a3557c6e [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Generated by Apache Maven Doxia at May 13, 2012 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Apache log4j 1.2 - </title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20120513" />
<meta http-equiv="Content-Language" content="en" />
</head>
<body class="composite">
<div id="banner">
<a href="../../" id="bannerLeft">
<img src="images/ls-logo.jpg" alt="Apache Logging Services Project" />
</a>
<a href=".." id="bannerRight">
<img src="images/logo.jpg" alt="Apache log4j™" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 2012-05-13</span>
&nbsp;| <span id="projectVersion">Version: 1.2.17</span>
| <a href="http://www.apache.org/" class="externalLink" title="Apache">Apache</a>
&gt;
<a href="../../" title="Logging Services">Logging Services</a>
&gt;
<a href="../" title="log4j">log4j</a>
&gt;
<a href="./" title="1.2">1.2</a>
</div>
<div class="xright">
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>About log4j 1.2</h5>
<ul>
<li class="none">
<strong>What is log4j?</strong>
</li>
<li class="none">
<a href="download.html" title="Download">Download</a>
</li>
<li class="none">
<a href="faq.html" title="FAQ">FAQ</a>
</li>
<li class="none">
<a href="roadmap.html" title="Roadmap">Roadmap</a>
</li>
</ul>
<h5>Community</h5>
<ul>
<li class="none">
<a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
<li class="none">
<a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
<li class="none">
<a href="http://blogs.apache.org/logging/" class="externalLink" title="Blog">Blog</a>
</li>
</ul>
<h5>Documentation</h5>
<ul>
<li class="none">
<a href="manual.html" title="Introduction">Introduction</a>
</li>
<li class="none">
<a href="apidocs/index.html" title="JavaDoc">JavaDoc</a>
</li>
<li class="none">
<a href="publications.html" title="Publications">Publications</a>
</li>
<li class="none">
<a href="building.html" title="Building">Building</a>
</li>
<li class="none">
<a href="http://wiki.apache.org/logging-log4j" class="externalLink" title="Wiki">Wiki</a>
</li>
</ul>
<h5>Project Documentation</h5>
<ul>
<li class="collapsed">
<a href="project-info.html" title="Project Information">Project Information</a>
</li>
<li class="collapsed">
<a href="project-reports.html" title="Project Reports">Project Reports</a>
</li>
</ul>
<h5>Apache</h5>
<ul>
<li class="none">
<a href="http://www.apache.org" class="externalLink" title="Home">Home</a>
</li>
<li class="none">
<a href="http://www.apache.org/licenses" class="externalLink" title="License">License</a>
</li>
<li class="none">
<a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship">Sponsorship</a>
</li>
<li class="none">
<a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks">Thanks</a>
</li>
<li class="none">
<a href="http://www.apache.org/security/" class="externalLink" title="Security">Security</a>
</li>
<li class="none">
<a href="http://www.apachecon.com" class="externalLink" title="Conferences">Conferences</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed to the Apache Software Foundation (ASF) under one or more --><!-- contributor license agreements. See the NOTICE file distributed with --><!-- this work for additional information regarding copyright ownership. --><!-- The ASF licenses this file to You under the Apache License, Version 2.0 --><!-- (the "License"); you may not use this file except in compliance with --><!-- the License. You may obtain a copy of the License at --><!-- --><!-- http://www.apache.org/licenses/LICENSE-2.0 --><!-- --><!-- Unless required by applicable law or agreed to in writing, software --><!-- distributed under the License is distributed on an "AS IS" BASIS, --><!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --><!-- See the License for the specific language governing permissions and --><!-- limitations under the License. -->
<div class="section">
<h2>End of Life</h2><p>On August 5, 2015 the Logging Services Project Management Committee announced that Log4j 1.x had reached end of life. For complete text of the announcement please see the <a href="http://blogs.apache.org/foundation/entry/apache_logging_services_project_announces">Apache Blog</a>. Users of Log4j 1 are recommended to upgrade to <a class="externalLink" href="http://logging.apache.org/log4j/2.x/index.html">Apache Log4j 2</a>.</p>
<h2>Security Vulnerabilities</h2>
<p>A security vulnerability, <a href="https://www.cvedetails.com/cve/CVE-2019-17571/">CVE-2019-17571</a> has been identified against Log4j 1. Since Log4j 1 is no longer maintained this issue will not be fixed. Users are urged to upgrade to Log4j 2.</p>
<h2>Java Version Incompatibilities</h2>
<p>The version detection algorithm changed in Java 9 which causes the MDC not to work properly. See <a href="https://blogs.apache.org/logging/entry/moving_on_to_log4j_2">Log4j 1.2 is broken on Java 9</a> for details.</p>
<h2>Apache log4j&#x2122; 1.2<a name="Apache_log4j_1.2"></a></h2><p>Welcome to Apache log4j, a logging library for Java. Apache log4j is an Apache Software Foundation Project and developed by a dedicated team of Committers of the Apache Software Foundation. For more info, please see <a class="externalLink" href="http://www.apache.org">The Apache Software Foundation</a>. Apache log4j is also part of a project which is known as <a class="externalLink" href="http://logging.apache.org">Apache Logging</a>. Please see the <a href="/license.html">License</a>.</p><p>If you are interested in the recent changes, visit our <a href="/changes-report.html">changes report</a>.</p>
<div class="section"><h3>Why logging?<a name="Why_logging"></a></h3><p>Inserting log statements into your code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications.</p><p>On the other hand, some people argue that log statements pollute source code and decrease legibility. (We believe that the contrary is true). In the Java language where a preprocessor is not available, log statements increase the size of the code and reduce its speed, even when logging is turned off. Given that a reasonably sized application may contain thousands of log statements, speed is of particular importance.</p></div>
<div class="section"><h3>Why log4j?<a name="Why_log4j"></a></h3><p>With log4j it is possible to enable logging at runtime without modifying the application binary. The log4j package is designed so that these statements can remain in shipped code without incurring a heavy performance cost. Logging behavior can be controlled by editing a configuration file, without touching the application binary.</p><p>Logging equips the developer with detailed context for application failures. On the other hand, testing provides quality assurance and confidence in the application. Logging and testing should not be confused. They are complementary. When logging is wisely used, it can prove to be an essential tool.</p><p>One of the distinctive features of log4j is the notion of inheritance in loggers. Using a logger hierarchy it is possible to control which log statements are output at arbitrarily fine granularity but also great ease. This helps to reduce the volume of logged output and the cost of logging.</p><p>The target of the log output can be a file, an OutputStream, a java.io.Writer, a remote log4j server, a remote Unix Syslog daemon, or many other output targets.</p></div>
<div class="section"><h3>Performance<a name="Performance"></a></h3><p>On an AMD Duron clocked at 800Mhz running JDK 1.3.1, it costs about 5 nanoseconds to determine if a logging statement should be logged or not. Actual logging is also quite fast, ranging from 21 microseconds using the SimpleLayout, 37 microseconds using the TTCCLayout. The performance of the PatternLayout is almost as good as the dedicated layouts, except that it is much more flexible.</p></div>
</div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xleft">Copyright &#169; 1999-2012
<a href="http://www.apache.org">Apache Software Foundation</a>.
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache Software License, Version 2.0</a>.</div>
<div class="xleft">Apache Extras Companion for Apache log4j, Apache log4j, Apache, the Apache feather logo,
the Apache Logging Services project logo, the log4j logo, and the Built by Maven logo are 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.</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>