[logback-user] [newbie] Setting up a project

Sebastien Pennec sebastien at qos.ch
Fri Mar 2 11:32:56 CET 2007


Hello again Alexandre,

I've tried to use a variable like you mentionned and it worked fine.

Could you try with this configuration file, and let me know if it works for you?

Thanks,

Sébastien

<configuration debug="true">

   <appender name="STDOUT"
     class="ch.qos.logback.core.ConsoleAppender">
     <layout class="ch.qos.logback.classic.PatternLayout">
       <Pattern>Application-A: %-4relative [%thread] %-5level - %msg %n</Pattern>
     </layout>
   </appender>

   <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
     <File>${catalina.home}/logs/testFile.log</File>
     <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
       <FileNamePattern>testFile.%i.log.zip</FileNamePattern>
       <MinIndex>1</MinIndex>
       <MaxIndex>3</MaxIndex>
     </rollingPolicy>

     <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
       <MaxFileSize>5MB</MaxFileSize>
     </triggeringPolicy>
     <layout class="ch.qos.logback.classic.PatternLayout">
       <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
     </layout>
   </appender>

   <root>
     <level value="debug" />
     <appender-ref ref="STDOUT" />
     <appender-ref ref="FILE" />
   </root>
</configuration>



Alexandre Jaquet wrote:
> Finally I found the translator
> 
> http://logback.qos.ch/translator/Translate.do
> 
> But with the parameter I've define under the <File> property :
> 
>  <File>${catalina.home}/logs/performance_test.log</File>
> 
> Doesn't create a log file withe my name performance_test.log under the
> tomcat log directory, what do I've missed ?
> 
> Thanks for your support,
> 
> Regards.
> 
> Alexandre Jaquet
> 
> Alexandre Jaquet wrote:
>> Hi,
>>
>> I'm new to logback and I'm trying to setting up a test project, who will 
>> use it.
>> When I used log4j I simply added a file log4.properties on my src root 
>> and define some paramaters. My question is
>> how to do the same, and wich paramaters I've to set.
>>
>> Thanks for your support.
>>
>> Regards.
>>
>> Alexandre Jaquet
>> _______________________________________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://qos.ch/mailman/listinfo/logback-user
>>
>>
> 

-- 
Sébastien Pennec
sebastien at qos.ch

Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch/



More information about the Logback-user mailing list