Hello I am using logback to write files and i have the below mentioned
appender configuration.
Below configuration works fine.

My question is,how to write the logs in current directory? Is it possible?

Currently written as, What i am looking is to write karaf.log on current
date directory. Would be helpful, if some experts could let me know about
the changes.

*2015-04-03*
*2015-04-04*
*2015-04-05*

*karaf.log*

<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>data/log/karaf.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>data/log/%d{yyyy-MM-dd}/karaf.%d{yyyy-MM-dd}.%i.gz
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 10MB -->
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 10 days worth of history -->
<maxHistory>10</maxHistory>
</rollingPolicy>
<append>true</append>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
_______________________________________________
Logback-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-user

Reply via email to