[logback-user] Help needed

Tony Trinh tony19 at gmail.com
Fri Jun 28 19:32:31 CEST 2013


On Fri, Jun 28, 2013 at 12:19 PM, Tony Trinh <tony19 at gmail.com> wrote:

>
> Then, in your logback.xml:
>
>
Just noticed the file paths in my example were not absolute paths, which
are required in logback-android. I've corrected the example below.

<configuration>
>
  <property name="LOG_DIR" value="/data/data/com.example/files/logback" />
>
  <appender name="FILE"
> class="ch.qos.logback.core.rolling.RollingFileAppender">
>     <file>${LOG_DIR}/logFile.log</file>
>     <rollingPolicy
> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>       <!-- hourly rollover -->
>       <fileNamePattern>${LOG_DIR}/logFile.%d{yyyy-MM-dd_HH}.log</
> fileNamePattern>
>
>       <!-- make that every 4 hours -->
>       <timeBasedFileNamingAndTriggeringPolicy
> class="com.example.MyTimeBasedTriggeringPolicy">
>           <timeMultiple>4</timeMultiple>
>       </timeBasedFileNamingAndTriggeringPolicy>
>     </rollingPolicy>
>
>     <encoder>
>       <pattern>%-4relative [%thread] %-5level %logger{35} -
> %msg%n</pattern>
>     </encoder>
>   </appender>
>
>   <root level="DEBUG">
>     <appender-ref ref="FILE" />
>   </root>
> </configuration>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130628/54acb610/attachment.html>


More information about the Logback-user mailing list