Thanks for your opinion about slf4j.
I don't intent to start a flamewar about loggers and what is neutral or not.
jackrabbit made his choice like all others.
In my maven project I added dependencies to :
<artifactId>jackrabbit-spi</artifactId>
<artifactId>jackrabbit-spi-commons</artifactId>
<artifactId>jackrabbit-jcr2spi</artifactId>
<artifactId>jackrabbit-jcr-commons</artifactId>
When trying to start my test application it raises this error :
Exception in thread "main" java.lang.NoClassDefFoundError:
org/slf4j/impl/StaticLoggerBinder
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)
at
org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory.<clinit>(AbstractQValueFactory.java:44)
at
org.geotoolkit.spi.AbstractRepositoryService.<init>(AbstractRepositoryService.java:28)
To make it work I have to volontarly add one more dependency like you
suggested :
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.5.3</version>
</dependency>
I guess that's the only solution for using jackrabbit.
thanks for the informations.
johann sorel
Geomatys
Alexander Klimetschek a écrit :
Hi,
slf4j gives you more flexibility in an environment with many libraries
and code you cannot control, where each uses its own logger
implementation. With slf4j you can (at deployment time)
a) essentially map all common logging APIs onto slf4j via the
so-called bridges and
b) choose what is used as implementation that writes the log files (or
whatever output is desired)
This is the most flexible and "neutral" way available.
Regards,
Alex
On Wed, Jul 29, 2009 at 1:36 PM, Martijn Hendriks<[email protected]> wrote:
Hi Johann,
Jackrabbit uses SLF4J in order to be able to choose the logging implementation
you want to use at deployment time (http://www.slf4j.org/). If you include a
org.slf4j.slf4j-jdk jar next to the jackrabbit jars then the default Java
logger is used. I hope that helps you.
Best regards,
Martijn
-----Original Message-----
From: sorel [mailto:[email protected]]
Sent: Wednesday, July 29, 2009 12:35 PM
To: [email protected]
Subject: Logger politic in Jackrabbit 2
Hello,
I'm starting to work with jackrabbit for a Geographic library,
GeotoolKit (http://www.geotoolkit.org).
Since our library is huge and has plenty of dependencies (jfreechart,
ardor3d, jasperreport ...) total 40Mb, 125 jar files.
Every project we are related to has more or less it's own Logging
politic.
- Log4J
- Commons-logging
- slf4j
- jlo
and some others ...
I believe that everyone will understand that all thoses logging systems
brings some redundant functionalities and a mess when we want to
configure the loggers. So our project has choosen a be neutral and uses
the default Java logger. We even asked some other project if a similar
neutral politic could be adopted too, sometimes with success sometimes
being ignored.
This might be a selfish request, but I would like to know if there is a
reason for the choice of slf4j over the standard logger in jackrabbit ?
Is the standard logger unappropriate ?
johann sorel
Geomatys