| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>4. Log4J</title><link rel="stylesheet" href="css/docbook.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="manual.html" title="Apache OpenJPA User's Guide"><link rel="up" href="ref_guide_logging.html" title="Chapter 3. Logging"><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 |
| </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" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ref_guide_logging_log4j"></a>4. |
| Log4J |
| </h2></div></div></div><a class="indexterm" name="d0e17129"></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 xmlns:xlink="http://www.w3.org/1999/xlink" href="http://jakarta.apache.org/log4j/docs/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.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> |