1

I use Log4Net Rolling File Appender with this config

<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
 <file type="log4net.Util.PatternString" value="Logs\%date{yyyy}\%date{MM}\%date{dd}\my.log" /> 
 <rollingStyle value="Date" />
 <datePattern value="yyyyMMdd'.log'" />
 <layout type="log4net.Layout.PatternLayout">
 <conversionPattern value="%date [%thread] %-5level - %message%newline" />
 </layout>
</appender>

I use dates to create location of log file : [ PatternString ]

<file type="log4net.Util.PatternString" value="Logs\%date{yyyy}\%date{MM}\%date{dd}\my.log" /> 
  • So when it start it create folders from year to date :e.g 2014/7/25/my.log then put my log file there.
  • But when day is changed to suppose 26 log4Net rename old log file to my.log20140725.log and created new file my.log.
  • But it still create the file under the folder day 25.

It seems that Log4Net just read the location of file once then does not update. How Can I force RollingFile Appender to check-update file location also?

Hippias Minor
  • 1,917
  • 2
  • 21
  • 46
  • 1
    I really do not understand who manages the StackOverflow. This site become really stupid.I do not know if stackoverflow gives bonus or points for this idiocity...marked as duplicate...I think this guys has no job...Go on stackoverflow like this...And you will be totally became an idiot also like those guys... – Hippias Minor Jul 31 '14 at 07:00
  • You can just say that "oh this may be an answer to your question" ...I will check and then said "yes or no"...But only I can decide this. Not stuartd EdChum Ivan Aristos Rayryeng or any another idiot guys who think they understand my question better than me... – Hippias Minor Jul 31 '14 at 07:07
  • It is suprisingly interesting stackoverflow has this kind of feature...It seems that stackoverflow support this kind of idiocity... – Hippias Minor Jul 31 '14 at 07:10

0 Answers0