I tried your configuration but it doesn't roll at specified size. It rolls approximately at maximumFileSize * 8. Which version of log4net do you use? There has been some work on RollingFileAppender according to release notes. I use log4net v 1.2.9.0
Andre -----Original Message----- From: Hollywood [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 4:01 PM To: Log4NET User Subject: Re: Rolling doesn't work based on size Here's my rolling log file appender configuration. And yes, it does roll at 1024kb. <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <param name="File" value="logs\\trace-${log4net.username}.log"/> <param name="AppendToFile" value="true"/> <param name="MaxSizeRollBackups" value="10"/> <param name="MaximumFileSize" value="1MB"/> <param name="RollingStyle" value="Size"/> <param name="StaticLogFileName" value="true"/> <param name="CountDirection" value="1"/> <layout type="log4net.Layout.PatternLayout,log4net"> <param name="Header" value="[Log Header]\r\n"/> <param name="Footer" value="[Log Footer]\r\n"/> <param name="ConversionPattern" value="%d %-5p %c.%m%n"/> </layout> <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="DEBUG" /> <levelMax value="INFO" /> </filter> </appender> ----- Original Message ----- From: "Piwoni, Andre" <[EMAIL PROTECTED]> To: "Log4NET User" <[email protected]> Sent: Thursday, May 04, 2006 3:55 PM Subject: RE: Rolling doesn't work based on size Actually, RollingLogFileAppender rolls file but not when maximumFileSize has been reached. I noticed that no matter what value I specify for maximumFileSize it rolls file when size reaches approximately maximumFileSize * 8. This suggest some byte/bit conversion bug. Andre ________________________________ From: Piwoni, Andre [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 11:36 AM To: [email protected] Subject: Rolling doesn't work based on size RollingLogFileAppender doesn't roll file based on size. It is used within windows service. Here's part of my configuration file: <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <file value="${windir}\\ FaxService.log" /> <appendToFile value="true" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="10" /> <maximumFileSize value="100KB" /> <staticLogFileName value="false" /> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /> </layout> </appender> Does anyone have any idea why? Andre E-Mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Sender is not liable for any loss or damage arising from this message. The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized. E-Mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Sender is not liable for any loss or damage arising from this message. The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized. E-Mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Sender is not liable for any loss or damage arising from this message. The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized.
