[logback-user] RollingFileAppender won't continue when log file is deleted
Ceki Gülcü
ceki at qos.ch
Fri Aug 26 19:53:14 CEST 2011
Hello,
Given that to the best of my knowledge there were no changes in code
related to recovery upon failure in version 0.9.29, I find it rather
implausible that 0.9.29 behaves any differently than 0.9.28. How sure
are you of the change in behavior? Under which OS and JDK are you
running your tests?
On 26/08/2011 4:58 PM, rlambert-den wrote:
>
> In development, our application generates an enormous amount of logging. For
> that reason it was handy with logback 0.9.28 to be able to just delete a log
> file and let the app continue and just start writing a to a new file.
>
> Unfortunately, in logback 0.9.29, that doesn't work. If I delete the current
> log file, logback does not create a new one. It just stops logging
> altogether. I'd be grateful for any tips on how to fix this and restore the
> old behavior (sorry, going back to 0.9.28 is not an option for political
> reasons).
>
> Our configuration has not changed and it is a pretty trivial
> RollingFileAppender (config is appended).
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration debug="false">
>
> <!-- test or production log setting -->
> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
> <encoder>
> <pattern>LEVEL:%-5level - %msg%n</pattern>
> </encoder>
> </appender>
>
> <appender name="FILE"
> class="ch.qos.logback.core.rolling.RollingFileAppender">
> <rollingPolicy
> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
> <!-- daily rollover -->
> <fileNamePattern>NetworkService.%d{yyyy-MM-dd}.log</fileNamePattern>
> <!-- keep 30 days' worth of history -->
> <maxHistory>7</maxHistory>
> </rollingPolicy>
> <encoder>
> <pattern>%d{HH:mm:ss.SSS} THREAD:[%thread] LEVEL:%-5level -
> %msg%n</pattern>
> </encoder>
> </appender>
>
> <logger name="NetworkService" level="DEBUG">
> <appender-ref ref="FILE" />
> <appender-ref ref="STDOUT" />
> </logger>
>
> </configuration>
>
>
--
QOS.ch, main sponsor of cal10n, logback and slf4j open source projects,
is looking to hire talented software developers. For further details,
see http://logback.qos.ch/job.html
More information about the Logback-user
mailing list