<div dir="ltr"><div><div class="gmail_signature"><div dir="ltr"><div><div><div>Hello I am using logback to write files and i have the below mentioned appender configuration.</div><div>Below configuration works fine.</div><div><br></div><div>My question is,how to write the logs in current directory? Is it possible? </div><div><br></div><div>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.</div><div><br></div><div><b>2015-04-03</b></div><div><b>2015-04-04</b></div><div><b>2015-04-05</b></div><div><br></div><div><b>karaf.log</b></div><div><br></div><div><appender name="FILE"</div><div><span class="" style="white-space:pre"> </span>class="ch.qos.logback.core.rolling.RollingFileAppender"></div><div><span class="" style="white-space:pre"> </span><file>data/log/karaf.log</file></div><div><span class="" style="white-space:pre"> </span><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"></div><div><span class="" style="white-space:pre"> </span><!-- daily rollover --></div><div><span class="" style="white-space:pre"> </span><fileNamePattern>data/log/%d{yyyy-MM-dd}/karaf.%d{yyyy-MM-dd}.%i.gz</div><div><span class="" style="white-space:pre"> </span></fileNamePattern></div><div><span class="" style="white-space:pre"> </span><timeBasedFileNamingAndTriggeringPolicy</div><div><span class="" style="white-space:pre"> </span>class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"></div><div><span class="" style="white-space:pre"> </span><!-- or whenever the file size reaches 10MB --></div><div><span class="" style="white-space:pre"> </span><maxFileSize>10MB</maxFileSize></div><div><span class="" style="white-space:pre"> </span></timeBasedFileNamingAndTriggeringPolicy></div><div><span class="" style="white-space:pre"> </span><!-- keep 10 days worth of history --></div><div><span class="" style="white-space:pre"> </span><maxHistory>10</maxHistory></div><div><span class="" style="white-space:pre"> </span></rollingPolicy></div><div><span class="" style="white-space:pre"> </span><append>true</append></div><div><span class="" style="white-space:pre"> </span><encoder></div><div><span class="" style="white-space:pre"> </span><pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</div><div><span class="" style="white-space:pre"> </span></pattern></div><div><span class="" style="white-space:pre"> </span></encoder></div><div><span class="" style="white-space:pre"> </span></appender></div></div></div></div></div></div>
</div>