You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by nati159 <na...@gmail.com> on 2009/05/11 16:19:45 UTC

Number of rollbackfiles does not have the desired effect when the file name inc the process id

Hi,

I need to configure the settings so that the max number of files will be 10
and the max file size will be 100KB. 

Whenever I am not including the process id in my file name the machanism
works fine. The problem starts when I have many logs with different process
ids (closed by closing and opening the application). 

The "MaxSizeRollBackups" & "maximumFileSize" properties have an effect only
if the application stays open (i.e. for the same process id).

How can I make configure log4net to take into consideration all the log
files when rolling the file and not only the ones which belongs to the last
process id?

the relevant part from my config file is attached:

<appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
		
        
        
        
        <maximumFileSize value="100KB" />
        
        
		<file type="log4net.Util.PatternString">
			<conversionPattern value="C:\log.ProcID_%processid.log" />
		</file>
		<threshold value="INFO"/>
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%d [%t] %-5p [%c|%C.%M] - %m%n" />
		</layout>
</appender>

Thanks,
Natalie.
-- 
View this message in context: http://www.nabble.com/Number-of-rollbackfiles-does-not-have-the-desired-effect-when-the-file-name-inc-the-process-id-tp23484269p23484269.html
Sent from the Log4net - Users mailing list archive at Nabble.com.