OpenEJB
  1. OpenEJB
  2. OPENEJB-1408

Allow another logging framework to be used

    Details

    • Type: Wish Wish
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.4
    • Fix Version/s: 4.0
    • Component/s: None
    • Labels:
      None

      Description

      Would be nice not to force a logging framework.
      OpenEJB drags log4j into a project which causes issues.

      If OpenEJB stuck to "Public" Log4J API, it would be possible to switch logging implementations using SLF4J & Wrappers.

      Currently:

      There is a HardCoded dependency on: org.apache.log4j.Layout

      Caused by org.apache.log4j.Layout
      java.net.URLClassLoader.findClass(URLClassLoader.java:497)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:639)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:605)
      at java.lang.J9VMInternals.verifyImpl(Native Method)
      at java.lang.J9VMInternals.verify(J9VMInternals.java:69)
      at java.lang.J9VMInternals.initialize(J9VMInternals.java:131)
      at org.apache.openejb.util.Logger.configure(Logger.java:61)
      at org.apache.openejb.util.Logger.<clinit>(Logger.java:29)

      1. openejb-slf4j.patch
        3 kB
        Michael Glauche

        Activity

        Hide
        Jean-Louis MONTEIRO added a comment -

        Committed for you.
        Thanks!

        Show
        Jean-Louis MONTEIRO added a comment - Committed for you. Thanks!
        Hide
        Michael Glauche added a comment -

        The attached patch provides a slf4j logging facility. To use it you'll need slf4-api in your classpath and add a line like this before the openejb server is started:

        System.setProperty("openejb.log.factory", "org.apache.openejb.util.Slf4jLogStreamFactory");

        To exclude other logging frameworks needed by openejb or its dependencies i'm using the following with maven2:

        <dependency>
        <groupId>org.apache.openejb</groupId>
        <artifactId>openejb-core</artifactId>
        <version>3.1.4</version>
        <scope>test</scope>
        <!-- exclude logging libraries -->
        <exclusions>
        <exclusion>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        </exclusion>
        <exclusion>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        </exclusion>
        </exclusions>
        </dependency>

        Show
        Michael Glauche added a comment - The attached patch provides a slf4j logging facility. To use it you'll need slf4-api in your classpath and add a line like this before the openejb server is started: System.setProperty("openejb.log.factory", "org.apache.openejb.util.Slf4jLogStreamFactory"); To exclude other logging frameworks needed by openejb or its dependencies i'm using the following with maven2: <dependency> <groupId>org.apache.openejb</groupId> <artifactId>openejb-core</artifactId> <version>3.1.4</version> <scope>test</scope> <!-- exclude logging libraries --> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency>
        Hide
        Michael Glauche added a comment -

        Patch to enable slf4j logging

        Show
        Michael Glauche added a comment - Patch to enable slf4j logging

          People

          • Assignee:
            Eric Gulatee
            Reporter:
            Eric Gulatee
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development