Hi All,
I have implemented RollingFileAppender to log my ASP errors and it works fine.
Now i need to change the file names based on the date value. Currently my log
file name is MyLog.log ,its max size is 1 MB and maxBackup is 10. Now i want
my log files with date like MyLog_2011-12-29 for each day. I tried the below
settings, but its not appending the date value to the file name and it just
creates the file as MyLog. Any suggestions ?
<appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="C:\\TestProj\\MyLog"/>
<staticLogFileName value="false"/>
<appendToFile value="true"/>
<rollingStyle value="Composite"/>
<eventId value="5" />
<eventCategory value="ErrorLogging" />
<datePattern value="yyyy-MM-dd'.log'" />
<maxSizeRollBackups value="10"/>
<maximumFileSize value="1MB"/>
<staticLogFileName value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n"/>
</layout>
</appender>
Thanks,
________________________________
This message contains Devin Group confidential information and is intended only
for the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail
in error and delete this e-mail from your system. E-mail transmissions cannot
be guaranteed secure, error-free and information could be intercepted,
corrupted, lost, destroyed, arrive late, incomplete, or contain viruses. The
sender therefore does not accept liability for errors or omissions in the
contents of this message which may arise as result of transmission. If
verification is required please request hard-copy version.