blob: ff4f8452e1f378e425174f5eb177e1e2d7dcbeb7 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>4.&nbsp; Log4J</title><base href="display"><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="manual.html" title="Apache OpenJPA 2.4 User's Guide"><link rel="up" href="ref_guide_logging.html" title="Chapter&nbsp;3.&nbsp; Logging and Auditing"><link rel="prev" href="ref_guide_logging_noop.html" title="3.&nbsp; Disabling Logging"><link rel="next" href="ref_guide_logging_commons.html" title="5.&nbsp; Apache Commons Logging"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.&nbsp;
Log4J
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_logging_noop.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;3.&nbsp;
Logging and Auditing
</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ref_guide_logging_commons.html">Next</a></td></tr></table><hr></div><div class="section" id="ref_guide_logging_log4j"><div class="titlepage"><div><div><h2 class="title" style="clear: both">4.&nbsp;
Log4J
</h2></div></div></div>
<a class="indexterm" name="d5e9350"></a>
<p>
When <code class="literal">openjpa.Log</code> is set to <code class="literal">log4j</code>, OpenJPA
will delegate to Log4J for logging. In a standalone application, Log4J logging
levels are controlled by a resource named <code class="filename">log4j.properties</code>
, which should be available as a top-level resource (either at the top level of
a jar file, or in the root of one of the <code class="literal">CLASSPATH</code>
directories). When deploying to a web or EJB application server, Log4J
configuration is often performed in a <code class="filename">log4j.xml</code> file
instead of a properties file. For further details on configuring Log4J, please
see the <a class="ulink" href="http://logging.apache.org/log4j/1.2/manual.html" target="_top">Log4J
Manual</a>. We present an example <code class="filename">log4j.properties</code> file
below.
</p>
<div class="example" id="ref_guide_logging_log4j_ex"><p class="title"><b>Example&nbsp;3.4.&nbsp;
Standard Log4J Logging
</b></p><div class="example-contents">
<pre class="programlisting">
log4j.rootCategory=WARN, console
log4j.category.openjpa.Tool=INFO
log4j.category.openjpa.Runtime=INFO
log4j.category.openjpa.Remote=WARN
log4j.category.openjpa.DataCache=WARN
log4j.category.openjpa.MetaData=WARN
log4j.category.openjpa.Enhance=WARN
log4j.category.openjpa.Query=WARN
log4j.category.openjpa.jdbc.SQL=WARN
log4j.category.openjpa.jdbc.SQLDiag=WARN
log4j.category.openjpa.jdbc.JDBC=WARN
log4j.category.openjpa.jdbc.Schema=WARN
log4j.appender.console=org.apache.log4j.ConsoleAppender
</pre>
</div></div><br class="example-break">
</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_logging_noop.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ref_guide_logging.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ref_guide_logging_commons.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.&nbsp;
Disabling Logging
&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;5.&nbsp;
Apache Commons Logging
</td></tr></table></div></body></html>