| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>4. Log4J</title><base href="display"><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="manual.html" title="Apache OpenJPA 2.2 User's Guide"><link rel="up" href="ref_guide_logging.html" title="Chapter 3. Logging and Auditing"><link rel="prev" href="ref_guide_logging_noop.html" title="3. Disabling Logging"><link rel="next" href="ref_guide_logging_commons.html" title="5. 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. |
| Log4J |
| </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_logging_noop.html">Prev</a> </td><th width="60%" align="center">Chapter 3. |
| Logging and Auditing |
| </th><td width="20%" align="right"> <a accesskey="n" href="ref_guide_logging_commons.html">Next</a></td></tr></table><hr></div><div class="section" title="4. Log4J"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="ref_guide_logging_log4j">4. |
| Log4J |
| </h2></div></div></div> |
| |
| <a class="indexterm" name="d5e9320"></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"><a name="ref_guide_logging_log4j_ex"></a><p class="title"><b>Example 3.4. |
| 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> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide_logging.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ref_guide_logging_commons.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3. |
| Disabling Logging |
| </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 5. |
| Apache Commons Logging |
| </td></tr></table></div></body></html> |