[slf4j-user] Missing a basic concept

Ceki Gülcü listid at qos.ch
Fri Nov 17 00:25:39 CET 2006


Hi Pat,

At 10:14 PM 11/13/2006, Pat Farrell wrote:
>Hi,
>
>I just found slf4j after years of working where I had to mentally jump
>from one logger say log4j to another (jdk1.4) and back at the whims of
>pointy haired bosses, so slf4j looks like an answer to my prayers.

The idea behind SLF4J is not new. Have you heard of JCL (Jakarta
commons logging)? It existed for years, well before SLF4J.


>But I'm missing a basic thing, I think.
>
>I wrote a trivial test driver using code straight out of the example in
>http://www.slf4j.org/manual.html
>
>First problem was that I just put
>slf4j-simple-1.1.0-RC0.jar on my classpath, and got lots of undefined
>symbols, like Logger. The solution seems to be to put both the
>slf4j-simple-1.1.0-RC0 and slf4j-api-1.1.0-RC0.jar on the path.
>Perhaps this is documented, or assumed when you talk about a facade, but
>it was not clear to me.

Well, as of version 1.1.0 all SLF4J bindings require
slf4j-api.jar. This is now emphasized in red in the docs.

>The second problem, which I have not resolved is that no logging occurs.
>Do I have to call some function of 'simple' to turn on logging, set the
>default level, assign a log file, etc.?

The configuration of the underlying logging system is done through the
API of that system, not SLF4J. For example, if you are using the log4j
binding, you must use the log4j API for its configuration.

I hope this helps,

>Thanks
>Pat
>--
>Pat Farrell
>http://www.pfarrell.com/
>

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch




More information about the slf4j-user mailing list