<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Suppose I'm developing a library that will be used in another
person's project and my library uses slf4j. And I don't know what
logging framework they use. Should my distribution include
slf4j-log412.jar and slf4j-jdk14.jar (or, better, specify both of
them as a dependency in my maven pom.xml)? Or should I include
instructions that they'll need to download and use either of those
jars, depending on which logging framework they're using?<br>
<br>
Here's what's in my pom.xml at the moment (for logging); the test
scope is what keeps the underlying logging framework I'm using
(logback) from being a runtime/compile dependency:<br>
<br>
<br>
<dependency><br>
<groupId>org.slf4j</groupId><br>
<artifactId>slf4j-api</artifactId><br>
<br>
<version>${version.slf4j}</version><br>
</dependency><br>
<br>
<dependency><br>
<groupId>commons-logging</groupId><br>
<artifactId>commons-logging</artifactId><br>
<br>
<!-- use provided scope on real JCL. --><br>
<!-- ensures it's not inadvertently pulled in, --><br>
<!-- so that we can use jcl-over-slf4j. --><br>
<br>
<version>1.1.1</version><br>
<br>
<scope>provided</scope><br>
</dependency><br>
<br>
<dependency><br>
<groupId>commons-logging</groupId><br>
<artifactId>commons-logging-api</artifactId><br>
<br>
<!-- use provided scope on real JCL. --><br>
<!-- ensures it's not inadvertently pulled in, --><br>
<!-- so that we can use jcl-over-slf4j. --><br>
<br>
<version>1.1</version><br>
<br>
<scope>provided</scope><br>
</dependency><br>
<br>
<!-- the slf4j commons-logging replacement --><br>
<!-- if any package is using jakarta commons logging this
will --><br>
<!-- re-route it through slf4j. --><br>
<dependency><br>
<groupId>org.slf4j</groupId><br>
<artifactId>jcl-over-slf4j</artifactId><br>
<br>
<version>${version.slf4j}</version><br>
<br>
<scope>test</scope><br>
</dependency><br>
<br>
<!-- the slf4j log4j replacement. --><br>
<!-- if any package is using log4j this will re-route
--><br>
<!-- it through slf4j. --><br>
<dependency><br>
<groupId>org.slf4j</groupId><br>
<artifactId>log4j-over-slf4j</artifactId><br>
<br>
<version>${version.slf4j}</version><br>
<br>
<scope>test</scope><br>
</dependency><br>
<br>
<!-- the slf4j java.util.logging replacement. --><br>
<!-- if any package is using java.util.logging this will
re-route --><br>
<!-- it through slf4j. --><br>
<dependency><br>
<groupId>org.slf4j</groupId><br>
<artifactId>jul-to-slf4j</artifactId><br>
<br>
<version>${version.slf4j}</version><br>
<br>
<scope>test</scope><br>
</dependency><br>
<br>
<dependency><br>
<groupId>ch.qos.logback</groupId><br>
<artifactId>logback-classic</artifactId><br>
<br>
<version>${version.logback}</version><br>
<br>
<scope>test</scope><br>
</dependency><br>
<br>
<br>
On 2011-08-11 13:36, Ceki Gülcü wrote:
<blockquote cite="mid:4E443D56.8090805@qos.ch" type="cite">Hi again,
<br>
<br>
Here is another more comprehensive attempt. It's hard for me to
say how much of an improvement these are.
<br>
<br>
Comments welcome.
<br>
--
<br>
Ceki
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
slf4j-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a>
<a class="moz-txt-link-freetext" href="http://qos.ch/mailman/listinfo/slf4j-user">http://qos.ch/mailman/listinfo/slf4j-user</a></pre>
</blockquote>
</body>
</html>