[logback-user] RollingFileAppender won't continue when log file is deleted

rlambert-den rlambert at demand-energy.com
Fri Aug 26 16:58:19 CEST 2011


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> 


-- 
View this message in context: http://old.nabble.com/RollingFileAppender-won%27t-continue-when-log-file-is-deleted-tp32342499p32342499.html
Sent from the Logback User mailing list archive at Nabble.com.



More information about the Logback-user mailing list