Why does log4net stop logging after a while on .NET WCF but not a usual website? -


i've search many sites , tried several different opinions. still not solve it. here things did right now:

  • in global.asax @ application_startup give file path , startup log4net.
  • right after start log4net, write log says "application has stared'"
  • currently, there 1 worker in iis wcf application iis user has access write, modify , read privileges

the problem:

  1. when invoke method of service directly (without doing 2. step below), no logs written
  2. on browser, write te wcf url , hit enter, log4net creates folder , files (files empty @ point).
  3. if make requests , invoke methods (doing 1st step), log4net writes logs.

the actual problem:

  • after 3rd step, (lets waited without invokes of wcf methods around 10 minutes or more), invoking does not create log4net text logs anymore.
  • sometimes, if repeat 2nd step, begins writing logs again. there no coherent results.

here config.xml:

 <?xml version="1.0" encoding="utf-8"?>      <log4net>        <appender name="processinfo_fileappender" type="log4net.appender.rollingfileappender">     <file type="log4net.util.patternstring" value="l:\logs\processinfo\processinfo_[%processid].txt" />     <lockingmodel type="log4net.appender.fileappender+minimallock" />      <appendtofile value="true" />     <rollingstyle value="composite" />     <maxsizerollbackups value="200" />     <maximumfilesize value="30mb" />     <layout type="log4net.layout.patternlayout">       <conversionpattern value="%date [%thread] - %message%newline" />     </layout>   </appender>       <logger name="processinfo">         <levelmin value="error" />         <levelmax value="info" />         <appender-ref ref="processinfo_fileappender" />       </logger>       <root></root>     </log4net> 

i have other wcf projects have no problem multiple workers. (i used exact same iis , log4net xml configuration them). also, mentioned on title, have website has exact same logging codes (they both using common 3rd party dll wrote) , has no problem of writing log4net text logging @ all.

please help.

thanks.

the problem not in logging configuration, should try enable log4net internal debugging. tell why logging stops. guess there code reconfigures logging load configuration web.config not there.

<configuration> ...     <appsettings>         <add key="log4net.internal.debug" value="true"/>     </appsettings>  ...      <system.diagnostics>         <trace autoflush="true">             <listeners>                 <add                      name="textwritertracelistener"                      type="system.diagnostics.textwritertracelistener"                      initializedata="c:\tmp\log4net.txt" />             </listeners>         </trace>     </system.diagnostics> </configuration> 

log4net faq


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -