You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by dw...@apache.org on 2010/07/20 21:17:58 UTC

svn commit: r965965 - in /openjpa/trunk: ./ openjpa-integration/ openjpa-integration/slf4j/ openjpa-integration/slf4j/src/ openjpa-integration/slf4j/src/test/ openjpa-integration/slf4j/src/test/java/ openjpa-integration/slf4j/src/test/java/org/ openjpa...

Author: dwoods
Date: Tue Jul 20 19:17:57 2010
New Revision: 965965

URL: http://svn.apache.org/viewvc?rev=965965&view=rev
Log:
OPENJPA-1732 LogFactory adapter for SLF4J

Added:
    openjpa/trunk/openjpa-integration/slf4j/
    openjpa/trunk/openjpa-integration/slf4j/pom.xml   (with props)
    openjpa/trunk/openjpa-integration/slf4j/src/
    openjpa/trunk/openjpa-integration/slf4j/src/test/
    openjpa/trunk/openjpa-integration/slf4j/src/test/java/
    openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/
    openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/
    openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/
    openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/integration/
    openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/integration/slf4j/
    openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/integration/slf4j/TestLogFactory.java   (with props)
    openjpa/trunk/openjpa-integration/slf4j/src/test/resources/
    openjpa/trunk/openjpa-integration/slf4j/src/test/resources/META-INF/
    openjpa/trunk/openjpa-integration/slf4j/src/test/resources/META-INF/persistence.xml   (with props)
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/SLF4JLogFactory.java   (with props)
Modified:
    openjpa/trunk/openjpa-integration/pom.xml
    openjpa/trunk/openjpa-lib/pom.xml
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
    openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml
    openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_logging.xml
    openjpa/trunk/pom.xml

Modified: openjpa/trunk/openjpa-integration/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/pom.xml?rev=965965&r1=965964&r2=965965&view=diff
==============================================================================
--- openjpa/trunk/openjpa-integration/pom.xml (original)
+++ openjpa/trunk/openjpa-integration/pom.xml Tue Jul 20 19:17:57 2010
@@ -38,6 +38,7 @@
     <modules>
         <module>daytrader</module>
         <module>examples</module>
+        <module>slf4j</module>
         <module>tck</module>
         <module>validation</module>
     </modules>

Added: openjpa/trunk/openjpa-integration/slf4j/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/slf4j/pom.xml?rev=965965&view=auto
==============================================================================
--- openjpa/trunk/openjpa-integration/slf4j/pom.xml (added)
+++ openjpa/trunk/openjpa-integration/slf4j/pom.xml Tue Jul 20 19:17:57 2010
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.   
+-->
+<!-- 
+    Maven release plugin requires the project tag to be on a single line. 
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.openjpa</groupId>
+        <artifactId>openjpa-integration</artifactId>
+        <version>2.1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>openjpa-integration-slf4j</artifactId>
+    <packaging>jar</packaging>
+    <name>OpenJPA Integration Tests - SLF4JLogFactory</name>
+    <description>OpenJPA Integration Tests - SLF4JLogFactory</description>
+
+    <properties>
+        <!-- use SLF4JLogFactory for logging -->
+        <openjpa.Log>slf4j</openjpa.Log>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${slf4jVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>${slf4jVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-persistence-jdbc</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+                <!-- remove commons-logging depend during SLF4J testing -->
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-persistence-jdbc</artifactId>
+            <version>${project.version}</version>
+            <!-- <classifier>tests</classifier> -->
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>attach-tests</id>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!-- new way of using openjpa-maven-plugin to enhance classes
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>openjpa-maven-plugin</artifactId>
+                <configuration>
+                    <includes>org/apache/openjpa/integration/slf4j/*.class</includes>
+                    <excludes>org/apache/openjpa/integration/slf4j/Test*.class</excludes>
+                    <addDefaultConstructor>true</addDefaultConstructor>
+                    <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>enhancer</id>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>test-enhance</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.openjpa</groupId>
+                        <artifactId>openjpa</artifactId>
+                        <version>${project.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.slf4j</groupId>
+                        <artifactId>slf4j-api</artifactId>
+                        <version>${slf4jVersion}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.slf4j</groupId>
+                        <artifactId>slf4j-simple</artifactId>
+                        <version>${slf4jVersion}</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            -->
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <argLine>${test.jvm.arguments}</argLine>
+                    <excludes>
+                        <!-- exclude classes that end with 'Test'; these 
+                             are not test cases per OpenJPA standards -->
+                        <exclude>org/apache/openjpa/**/*Test.java</exclude>
+
+                        <!-- exclude classes that include a $; inner classes
+                             are not test cases per OpenJPA standards -->
+                        <exclude>org/apache/openjpa/**/*$*.class</exclude>
+                        <exclude>org/apache/openjpa/**/*.*.class</exclude>
+                    </excludes>
+                    <systemProperties>
+                        <property>
+                            <name>openjpa.Log</name>
+                            <value>${openjpa.Log}</value>
+                        </property>
+                        <property>
+                            <name>openjpa.DynamicEnhancementAgent</name>
+                            <value>false</value>
+                        </property>
+                        <property>
+                            <name>openjpa.ConnectionDriverName</name>
+                            <value>org.apache.commons.dbcp.BasicDataSource</value>
+                        </property>
+                        <property>
+                            <name>derby.stream.error.file</name>
+                            <value>target/derby.log</value>
+                        </property>
+                        <property>
+                            <name>derby.locks.deadlockTimeout</name>
+                            <value>5</value>
+                        </property>
+                        <property>
+                            <name>derby.locks.waitTimeout</name>
+                            <value>6</value>
+                        </property>
+                        <property>
+                            <name>openjpa.ConnectionProperties</name>
+                            <value>DriverClassName=${connection.driver.name},Url=${connection.url},Username=${connection.username},Password=${connection.password},${dbcp.args}</value>
+                        </property>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: openjpa/trunk/openjpa-integration/slf4j/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/integration/slf4j/TestLogFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/integration/slf4j/TestLogFactory.java?rev=965965&view=auto
==============================================================================
--- openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/integration/slf4j/TestLogFactory.java (added)
+++ openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/integration/slf4j/TestLogFactory.java Tue Jul 20 19:17:57 2010
@@ -0,0 +1,52 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.integration.slf4j;
+
+import javax.persistence.EntityManager;
+
+import org.apache.openjpa.lib.log.Log;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
+import org.apache.openjpa.persistence.test.SingleEMFTestCase;
+
+/**
+ * Simple test case to verify SLF4JLogFactory is being loaded
+ */
+public class TestLogFactory extends SingleEMFTestCase {
+
+    public void testSLF4J() {
+        OpenJPAEntityManagerFactorySPI emf = createNamedEMF("openjpa-integration-slf4j");
+        try {
+            EntityManager em = emf.createEntityManager();
+            
+            // do some logging
+            Log log = getLog();
+            String logFactory = log.getClass().getName();
+            log.info("Log class=" + logFactory);
+            assertTrue("SLF4JLogFactory", logFactory.indexOf("SLF4JLogFactory") != -1);
+            // next one should not be logged if using slf4j-simple binding - only INFO, WARN and ERROR
+            log.trace("TRACE level logging");
+            
+            em.close();
+        } finally {
+            closeEMF(emf);
+        }
+    }
+
+}
+

Propchange: openjpa/trunk/openjpa-integration/slf4j/src/test/java/org/apache/openjpa/integration/slf4j/TestLogFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-integration/slf4j/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-integration/slf4j/src/test/resources/META-INF/persistence.xml?rev=965965&view=auto
==============================================================================
--- openjpa/trunk/openjpa-integration/slf4j/src/test/resources/META-INF/persistence.xml (added)
+++ openjpa/trunk/openjpa-integration/slf4j/src/test/resources/META-INF/persistence.xml Tue Jul 20 19:17:57 2010
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    version="2.0">
+
+    <persistence-unit name="openjpa-integration-slf4j">
+        <description>PU for SLF4J tests</description>
+        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+        <exclude-unlisted-classes>true</exclude-unlisted-classes>
+        
+        <properties>
+            <property name="openjpa.Log" value="slf4j"/>
+            <property name="openjpa.DynamicEnhancementAgent" value="false"/>
+        </properties>
+    </persistence-unit>
+</persistence>

Propchange: openjpa/trunk/openjpa-integration/slf4j/src/test/resources/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openjpa/trunk/openjpa-lib/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/pom.xml?rev=965965&r1=965964&r2=965965&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/pom.xml (original)
+++ openjpa/trunk/openjpa-lib/pom.xml Tue Jul 20 19:17:57 2010
@@ -49,6 +49,11 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>commons-lang</groupId>
             <artifactId>commons-lang</artifactId>
         </dependency>

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?rev=965965&r1=965964&r2=965965&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java Tue Jul 20 19:17:57 2010
@@ -149,6 +149,7 @@ public class ConfigurationImpl
             "openjpa", LogFactoryImpl.class.getName(),
             "commons", "org.apache.openjpa.lib.log.CommonsLogFactory",
             "log4j", "org.apache.openjpa.lib.log.Log4JLogFactory",
+            "slf4j", "org.apache.openjpa.lib.log.SLF4JLogFactory",
             "none", NoneLogFactory.class.getName(),
             "false", NoneLogFactory.class.getName(),
         };

Added: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/SLF4JLogFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/SLF4JLogFactory.java?rev=965965&view=auto
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/SLF4JLogFactory.java (added)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/SLF4JLogFactory.java Tue Jul 20 19:17:57 2010
@@ -0,0 +1,135 @@
+/*
+ * 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.    
+ */
+package org.apache.openjpa.lib.log;
+
+import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
+
+/**
+ * {@link LogFactory} implementation that delegates to the SLF4J framework.
+ *
+ */
+public class SLF4JLogFactory extends LogFactoryAdapter {
+
+    protected Log newLogAdapter(String channel) {
+        return new LogAdapter((Logger) LoggerFactory.getLogger(channel));
+    }
+
+    /**
+     * Adapts a Log4J logger to the {@link org.apache.openjpa.lib.log.Log}
+     * interface.
+     */
+    public static class LogAdapter implements Log {
+
+        private Logger _log;
+
+        private LogAdapter(Logger wrapee) {
+            _log = wrapee;
+        }
+
+        public Logger getDelegate() {
+            return _log;
+        }
+
+        public boolean isTraceEnabled() {
+            return _log.isTraceEnabled();
+        }
+
+        // added for SLF4J - not in Log4JLogFactory
+        public boolean isDebugEnabled() {
+            return _log.isDebugEnabled();
+        }
+
+        public boolean isInfoEnabled() {
+            return _log.isInfoEnabled();
+        }
+
+        public boolean isWarnEnabled() {
+            return _log.isWarnEnabled();
+        }
+
+        public boolean isErrorEnabled() {
+            return _log.isErrorEnabled();
+        }
+
+        public boolean isFatalEnabled() {
+            // SLF4J has no FATAL level, so map to ERROR like log4j-over-slf4j
+            return _log.isErrorEnabled();
+        }
+
+        public void trace(Object o) {
+            _log.trace(objectToString(o));
+        }
+
+        public void trace(Object o, Throwable t) {
+            _log.trace(objectToString(o), t);
+        }
+
+        // added for SLF4J - not in Log4JLogFactory
+        public void debug(Object o) {
+            _log.debug(objectToString(o));
+        }
+
+        // added for SLF4J - not in Log4JLogFactory
+        public void debug(Object o, Throwable t) {
+            _log.debug(objectToString(o), t);
+        }
+
+        public void info(Object o) {
+            _log.info(objectToString(o));
+        }
+
+        public void info(Object o, Throwable t) {
+            _log.info(objectToString(o), t);
+        }
+
+        public void warn(Object o) {
+            _log.warn(objectToString(o));
+        }
+
+        public void warn(Object o, Throwable t) {
+            _log.warn(objectToString(o), t);
+        }
+
+        public void error(Object o) {
+            _log.error(objectToString(o));
+        }
+
+        public void error(Object o, Throwable t) {
+            _log.error(objectToString(o), t);
+        }
+
+        public void fatal(Object o) {
+            // SLF4J has no FATAL level, so map to ERROR like log4j-over-slf4j
+            _log.error(objectToString(o));
+        }
+
+        public void fatal(Object o, Throwable t) {
+            // SLF4J has no FATAL level, so map to ERROR like log4j-over-slf4j
+            _log.error(objectToString(o), t);
+        }
+
+        private String objectToString(Object o) {
+            if (o == null)
+                return (String) o;
+            else
+                return o.toString();
+        }
+    }
+}

Propchange: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/SLF4JLogFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml?rev=965965&r1=965964&r2=965965&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml Tue Jul 20 19:17:57 2010
@@ -2296,7 +2296,8 @@ for an object lock before throwing an ex
             </para>
             <para>
 <emphasis role="bold">Possible values: </emphasis><literal>openjpa</literal>,
-<literal>commons</literal>, <literal>log4j</literal>, <literal>none</literal>
+<literal>commons</literal>, <literal>log4j</literal>, <literal>slf4j</literal>,
+<literal>none</literal>
             </para>
             <para>
 <emphasis role="bold">Description:</emphasis> A plugin string (see

Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_logging.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_logging.xml?rev=965965&r1=965964&r2=965965&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_logging.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_logging.xml Tue Jul 20 19:17:57 2010
@@ -37,9 +37,10 @@ behavior. OpenJPA provides a flexible lo
 existing runtime systems, such as application servers and servlet runners.
     </para>
     <para>
-There are four built-in logging plugins: a
+There are five built-in logging plugins: a
 <link linkend="ref_guide_logging_openjpa">default logging framework</link> that
 covers most needs, a <link linkend="ref_guide_logging_log4j"> Log4J</link>
+delegate, a <link linkend="ref_guide_logging_slf4j"> SLF4J</link>
 delegate, an <link linkend="ref_guide_logging_commons"> Apache Commons Logging
 </link> delegate, and a <link linkend="ref_guide_logging_noop">no-op</link>
 implementation for disabling logging.
@@ -503,6 +504,31 @@ openjpa.jdbc.Schema.level=INFO
             </example>
         </section>
     </section>
+    <section id="ref_guide_logging_slf4j">
+        <title>
+            SLF4J
+        </title>
+        <indexterm zone="ref_guide_logging_slf4j">
+            <primary>
+                logging
+            </primary>
+            <secondary>
+                SLF4j
+            </secondary>
+        </indexterm>
+        <para>
+When <literal>openjpa.Log</literal> is set to <literal>slf4j</literal>, OpenJPA
+will delegate to SLF4J API for logging, which provides several adapters or
+a simple logging mechanism. For further details on logging adapters and
+configuring SLF4J, please see the
+<ulink url="http://www.slf4j.org/manual.html">SLF4J website</ulink>.
+        </para>
+        <para>
+Note, as SLF4J does not provide a <literal>FATAL</literal> log level the
+<literal>SLF4JLogFactory</literal> will map it to the <literal>ERROR</literal>
+log level.
+        </para>
+    </section>
     <section id="ref_guide_logging_custom">
         <title>
             Custom Log

Modified: openjpa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/pom.xml?rev=965965&r1=965964&r2=965965&view=diff
==============================================================================
--- openjpa/trunk/pom.xml (original)
+++ openjpa/trunk/pom.xml Tue Jul 20 19:17:57 2010
@@ -70,6 +70,8 @@
         <derby.version>10.5.3.0_1</derby.version>
         <hsqldb.version>1.8.0.10</hsqldb.version>
         <mysql.version>5.1.12</mysql.version>
+        <!-- other common versions -->
+        <slf4jVersion>1.6.1</slf4jVersion>
     </properties>
 
     <licenses>
@@ -694,6 +696,11 @@
                 <version>1.2.13</version>
             </dependency>
             <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-api</artifactId>
+                <version>${slf4jVersion}</version>
+            </dependency>
+            <dependency>
                 <groupId>ant</groupId>
                 <artifactId>ant</artifactId>
                 <version>1.6.5</version>