[slf4j-user] How to configure logger for jackrabbit-standalone-2.6.0.jar

Ulrich Forums at gombers.de
Tue Apr 9 09:46:05 CEST 2013


I'm trying to setup logging with a program using the
jackrabbit-standalone-2.6.0.jar. This archive contains some slf4j-packages
(org.slf4j, org.slf4j.helpers, org.slf4j.impl, org.slf4j.spi)  but as far as I
can see no logging framework. But when I add the slf4j-log4j12-1.7.2.jar I get
the messages:

SLF4J: Found binding in
[jar:file:/D:/Anwendungen/EclipsePlugins/Jackrabbit/jackrabbit-standalone-2.6.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/D:/Anwendungen/EclipsePlugins/slf4j-1.7.2/slf4j-1.7.2/slf4j-log4j12-1.7.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]

Is there an opportunity to see which kind of implementer is used here?

I want to configure the logger. Right now it writes a big amount of DEBUG
messages to a file called "jackrabit.log_IS_UNDEFINED" and I urgently need to
suppress this. There are several hints  to be found in the internet suggesting
to setup the logger but I don't exactly understand what I need to do.
The classes  "DOMConfigurator" and "PropertyConfigurator" are not available
within the package, but when adding for example "slf4j-log4j12-1.7.2.jar" I get
the above described messages. So I can't initialize the logger within my
program.
It was said to add the configuration-XML to the classpath. I tried this (in
Eclipse I added the folder conatining the XML to the BuildPath, then I created a
jar-file from my XML-File and added this jar-file to the BuildPath) but it
didn't make any difference.

I read the description "Default Initialization Procedure" in
http://logging.apache.org/log4j/1.2/manual.html but have to state that I didn't
understand it at all.
What does it mean:
2. Set the resource string variable to the value of the log4j.configuration
system property. The preferred way to specify the default initialization file is
through the log4j.configuration system property. In case the system property
log4j.configuration is not defined, then set the string variable resource to its
default value "log4j.properties".
Where do I have to specify the resource-string variable?

my log4j.xml-file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
     <appender name="Console" class="org.apache.log4j.ConsoleAppender">
         <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d  %-5p  [%c{1}] %m %n" />
        </layout>
    </appender>

    <root>
        <priority value="info" />
        <appender-ref ref="Console" />
    </root>
</log4j:configuration>


Any idea to configure the logger either programmatically or be default
initialization is very welcome.

Ulrich


More information about the slf4j-user mailing list