[slf4j-user] Logging to file with slf4j.Logger. Where do log file go?

Tom Martin Norvang tnorvang at gmail.com
Fri Mar 20 00:36:45 CET 2009


Thank you for the mail info. If you are asking about wich slf4j jar i placed
the slf4j-api-1.5.6.jar and slf4j-jdk14-1.5.6.jar at the root: c:\ alongside
the logback.xml. The classpath variable contains a dot (.) and a
....\jre\ext\QTJava.zip. So i am not sure if the . (dot) represents the root
directory og current disk or system disk where OS recide, i have os on E:
and another disk c:. But anyways i did add the jars under project properties
as external jars and the Test class compiles and runs without error, it just
that no log file appear anywhere.

Tom Martin Norvang

2009/3/19 Ceki Gulcu <ceki at qos.ch>

> Hello Tom,
>
> The following mailing list archives which are all mentioned in
> http://slf4j.org/mailing-lists.html are searchable:
>
> http://news.gmane.org/gmane.comp.java.slf4j.user
> http://marc.theaimsgroup.com/?l=slf4j-user
> http://www.nabble.com/Slf4J---user-f13203.html
> http://www.mail-archive.com/user%40slf4j.org/
>
>
> Which jar files have you placed on your class path?
>
> For FileAppender the file attribute should be:
>
>  <file>c:/testlog1.log</file>
>
> Tom Martin Norvang wrote:
>
>> Hi i am new to slf4j and have a few questions. I could not find out how to
>> search the mailing list for older messages that might contain this subject.
>> And i have searched everywhere online :)..almost.
>>
>> 1. Where do log files go when using the slf4j.Logger, f.ex;
>>
>> import org.slf4j.Logger;
>> import org.slf4j.LoggerFactory;
>>
>> public class Testing {
>>      private static final Logger LOGGER =
>> LoggerFactory.getLogger(Testing.class);
>>
>>    public static void main(String[] args) {
>>              int value = 10;
>>        LOGGER.debug("the variable value ="+value);
>>        LOGGER.debug("The value of value = "+value);
>>    }
>> }
>>
>> I am currently using eclipse, project structure and have placed a
>> logback.xml file under the project root folder. The logback.xml file is an
>> example file from the slf4j homepage;
>> <configuration>
>>
>>  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
>>    <file>"c:\testlog1.log"</file>
>>
>>    <layout class="ch.qos.logback.classic.PatternLayout">
>>      <Pattern>%date %level [%thread] %logger{10} [%file:%line]
>> %msg%n</Pattern>
>>    </layout>
>>  </appender>
>>
>>  <root>
>>    <level value="debug" />
>>    <appender-ref ref="FILE" />
>>  </root>
>> </configuration>
>>
>> No complaining about the slf4j jar files either.
>> The small application runs fine but i suspect that my logback.xml file is
>> not in the right place and not read at all. I have tried to put it in
>> several locations (JAVA_HOME, path, src folder etc). to no avail. I also did
>> a search trough the whole disc, but no such file(testlog1.log). Any ideas
>> what i am doing wrong. By the way i am on WinXP SP2 with JDK1.6.11.
>> Installed.
>>
>> Regards Tom Martin
>>
>>
>>  --
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework for
> Java.
> http://logback.qos.ch
> _______________________________________________
> user mailing list
> user at slf4j.org
> http://www.slf4j.org/mailman/listinfo/user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-user/attachments/20090320/ea3faf11/attachment.htm>


More information about the slf4j-user mailing list