c# - log4net strange file name behavior -


i have asp.net application using log4net, have daily log file, config looks like:

<appender name="rollingfile" type="log4net.appender.rollingfileappender">   <file type="log4net.util.patternstring" value="log\log_%property{log4net:hostname}_" />   <appendtofile value="true" />   <staticlogfilename value="false" />   <rollingstyle value="date" />   <datepattern value="yyyymmdd'.txt'" />   <maxsizerollbackups value="7" />   <maximumfilesize value="10mb" />   <lockingmodel type="log4net.appender.fileappender+minimallock" />   <layout type="log4net.layout.patternlayout">     <conversionpattern value="%date [%-5level] (%logger)(%thread) %message %newline" />   </layout> </appender> 

sometime, there strange naming pattern file appear, looks no reason (at least not due maximum file-size), what's going wrong ?

enter image description here

one of possible problems application identity (app pool identity) not have enough permissions log folder. try change application identity more powerful user or give more permission (full control sure).

another possible reason first log file log_smv-prod-app07_20160907.txt locked process (you can find using procmon.exe). log4net can not write , creates new log file log_smv-prod-app07_20160907.txt20160907.txt. try figure out locks , hope you'll find solution.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -