Skip to content

Commit

Permalink
Merge branch 'master' of github.com:qos-ch/slf4j
Browse files Browse the repository at this point in the history
  • Loading branch information
ceki committed May 30, 2013
2 parents 6ddf497 + c2bf453 commit 1e97682
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 43 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -38,7 +38,7 @@
<slf4j.api.minimum.compatible.version>1.6.0</slf4j.api.minimum.compatible.version>
<cal10n.version>0.8.1</cal10n.version>
<log4j.version>1.2.17</log4j.version>
<logback.version>1.0.11</logback.version>
<logback.version>1.0.13</logback.version>
<junit.version>4.10</junit.version>
</properties>

Expand Down
14 changes: 7 additions & 7 deletions slf4j-site/src/site/pages/index.html 100644 → 100755
Expand Up @@ -26,10 +26,10 @@

<h1>Simple Logging Facade for Java (SLF4J)</h1>

<p>The Simple Logging Facade for Java or (SLF4J) serves as a simple
facade or abstraction for various logging frameworks, e.g.
java.util.logging, log4j and logback, allowing the end user to plug
in the desired logging framework at <em>deployment</em>
<p>The Simple Logging Facade for Java (SLF4J) serves as a simple
facade or abstraction for various logging frameworks
(e.g. java.util.logging, logback, log4j) allowing the end user to
plug in the desired logging framework at <em>deployment</em>
time. </p>

<p>Before you start using SLF4J, we highly recommend that you read
Expand All @@ -44,7 +44,7 @@ <h1>Simple Logging Facade for Java (SLF4J)</h1>

<p>In case you wish to migrate your Java source files to SLF4J,
consider our <a href="migrator.html">migrator tool</a> which can
migrate your project into SLF4J in minutes.</p>
migrate your project to use the SLF4J API in just a few minutes.</p>

<p>In case an externally-maintained component you depend on uses a
logging API other than SLF4J, such as commons logging, log4j or
Expand Down Expand Up @@ -97,6 +97,7 @@ <h3>Projects depending on SLF4J</h3>
<td valign="top">
<ul>
<li><a href="http://ehcache.org/">Ehcache</a></li>
<li><a href="http://groovy.codehaus.org/GMaven">GMaven</a></li>
<li><a href="http://www.gradle.org/">Gradle</a></li>
<li><a href="http://www.icegreen.com/greenmail/">GreenMail</a></li>
<li><a href="http://gumtree.codehaus.org/">GumTree</a></li>
Expand All @@ -106,7 +107,6 @@ <h3>Projects depending on SLF4J</h3>
<li><a href="http://code.google.com/p/igenko/">Igenko</a></li>
<li><a href="http://jabsorb.org/">Jabsorb</a></li>
<li><a href="http://jetty.mortbay.org/">Jetty v6</a></li>
<li><a href="http://www.topmind.biz/html/index.php">jLynx</a></li>
</ul>
</td>
</tr>
Expand All @@ -115,7 +115,7 @@ <h3>Projects depending on SLF4J</h3>

<td valign="top">
<ul>
<li><a href="http://groovy.codehaus.org/GMaven">GMaven</a></li>
<li><a href="http://www.topmind.biz/html/index.php">jLynx</a></li>
<li><a href="http://code.google.com/p/jmesa/">JMesa</a></li>
<li><a href="http://www.artofsolving.com/opensource/jodconverter">JODConverter</a></li>
<li><a href="http://jtrac.info/dependencies.html">JTrac</a></li>
Expand Down
82 changes: 47 additions & 35 deletions slf4j-site/src/site/pages/manual.html
Expand Up @@ -22,12 +22,12 @@

<h2>SLF4J user manual</h2>

<p>The Simple Logging Facade for Java or (SLF4J) serves as a
simple facade or abstraction for various logging frameworks, such
as java.util.logging, log4j and logback. SLF4J allows the end-user
to plug in the desired logging framework at <em>deployment</em>
time. Note that SLF4J-enabling your library/application implies
the addition of only a single mandatory dependency, namely
<p>The Simple Logging Facade for Java (SLF4J) serves as a simple
facade or abstraction for various logging frameworks, such as
java.util.logging, logback and log4j. SLF4J allows the end-user to
plug in the desired logging framework at <em>deployment</em> time.
Note that SLF4J-enabling your library/application implies the
addition of only a single mandatory dependency, namely
<em>slf4j-api-${project.version}.jar</em>.</p>

<p><span class="label">since 1.6.0</span> If no binding is found on the
Expand All @@ -43,8 +43,8 @@ <h2>SLF4J user manual</h2>
requires JDK 1.5 or later. Under the hood the Java compiler
transforms the varargs part in methods into
<code>Object[]</code>. Thus, the Logger interface generated by the
compiler is indistinguishable in 1.7.0 from its 1.6.0
counterpart. It follows that SLF4J version 1.7.0 is totally 100%
compiler is indistinguishable in 1.7.x from its 1.6.x
counterpart. It follows that SLF4J version 1.7.x is totally 100%
no-ifs-or-buts compatible with SLF4J version 1.6.x.
</p>

Expand Down Expand Up @@ -86,8 +86,8 @@ <h3 class="doAnchor" name="hello_world">Hello World</h3>
<p>This warning is printed because no slf4j binding could be
found on your class path.</p>

<p>The warning will disappear as soon as you add a binding to
your class path. Assuming you add
<p>The warning will disappear as soon as you add a <a
href="#swapping">binding</a> to your class path. Assuming you add
<em>slf4j-simple-${project.version}.jar</em> so that your class
path contains:</p>

Expand Down Expand Up @@ -177,18 +177,25 @@ <h3 class="doAnchor" name="swapping">Binding with a logging
Logging</a>. This binding will delegate all SLF4J logging to
JCL.<p/>
</dd>

<dt><em>logback-classic-${logback.version}.jar (requires logback-core-${logback.version}.jar)</em></dt>

<dd><span class="label notice">Native implementation</span> There are also
SLF4J bindings external to the SLF4J project, e.g. <a
href="http://logback.qos.ch/">logback</a> which implements
SLF4J natively. Logback's
<a href="http://logback.qos.ch/apidocs/ch/qos/logback/classic/Logger.html">
<code>ch.qos.logback.classic.Logger</code></a> class is a
direct implementation of SLF4J's <a
href="http://www.slf4j.org/apidocs/org/slf4j/Logger.html">
<code>org.slf4j.Logger</code></a> interface. Thus, using SLF4J
in conjunction with logback involves strictly zero memory and
computational overhead.

</dd>
</dl>

<p>There are also SLF4J bindings external to the SLF4J project,
e.g. <a href="http://logback.qos.ch/">logback</a> which
implements SLF4J natively. Logback's
<a href="http://logback.qos.ch/apidocs/ch/qos/logback/classic/Logger.html">
<code>ch.qos.logback.classic.Logger</code></a> class is a direct
implementation of SLF4J's
<a href="http://www.slf4j.org/apidocs/org/slf4j/Logger.html">
<code>org.slf4j.Logger</code></a> interface. Thus, using SLF4J
in conjunction with logback involves strictly zero memory and
computational overhead.
<p>
</p>


Expand Down Expand Up @@ -233,13 +240,12 @@ <h3 class="doAnchor" name="libraries">Libraries</h3>

<p>Authors of widely-distributed components and libraries may
code against the SLF4J interface in order to avoid imposing an
logging framework on the end-user of the component or library.
Thus, the end-user may choose the desired logging framework at
deployment time by inserting the corresponding slf4j binding on
the classpath, which may be changed later by replacing an
existing binding with another on the class path and restarting
the application. This approach has proven to be simple and very
robust.
logging framework on their end-user. Thus, the end-user may
choose the desired logging framework at deployment time by
inserting the corresponding slf4j binding on the classpath,
which may be changed later by replacing an existing binding with
another on the class path and restarting the application. This
approach has proven to be simple and very robust.
</p>

<p><b>As of SLF4J version 1.6.0</b>, if no binding is found on
Expand All @@ -261,18 +267,24 @@ <h3 class="doAnchor" name="libraries">Libraries</h3>
corresponding to the logging framework chosen by her.
</p>


<h3 class="doAnchor" name="projectDep">Declaring project
dependencies for logging</h3>

<p><b>Please note that embedded components such as libraries or
frameworks should not declare a dependency on any SLF4J binding
but only depend on slf4j-api.</b> SLF4J usage in embedded
components is also discussed in the FAQ in relation with <a
<p><span class="label">Basic rule</span> <b>Embedded components
such as libraries or frameworks should not declare a dependency
on any SLF4J binding but only depend on slf4j-api</b>. When a
library declares a transitive dependency on a specific binding,
that binding is imposed on the end-user negating the purpose of
SLF4J. Note that declaring a non-transitve dependecy on a
binding, for example for testing, does not affect the
end-user.</p>

<p>SLF4J usage in embedded components is also discussed in the
FAQ in relation with <a
href="faq.html#configure_logging">logging configuration</a>, <a
href="faq.html#optional_dependency">dependency reduction</a> and
<a href="faq.html#optional_dependency">testing</a>.</p>

<h3 class="doAnchor" name="projectDep">Declaring project
dependencies for logging</h3>

<p>Given Maven's transitive dependency rules, for "regular"
projects (not libraries or frameworks) declaring logging
dependencies can be accomplished with a single dependency
Expand Down

0 comments on commit 1e97682

Please sign in to comment.