You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Michael Glauche (JIRA)" <ji...@apache.org> on 2011/04/01 11:48:05 UTC

[jira] [Commented] (OPENEJB-1408) Allow another logging framework to be used

    [ https://issues.apache.org/jira/browse/OPENEJB-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014494#comment-13014494 ] 

Michael Glauche commented on OPENEJB-1408:
------------------------------------------

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>


> Allow another logging framework to be used
> ------------------------------------------
>
>                 Key: OPENEJB-1408
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1408
>             Project: OpenEJB
>          Issue Type: Wish
>    Affects Versions: 3.1.4
>            Reporter: Eric Gulatee
>         Attachments: openejb-slf4j.patch
>
>
> 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) 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira