views:

973

answers:

3

Hello

I have a web app that uses log4net to log errors to a log file. It works well when I publish my website via xcopy but when I build a package installer, log4net does not appear to work when remote users access my site.

I use impersonate=true in my web.config and log4net only logs errors when I am the logged user.

I have another app that works fine in all cases but was not package deployed.

Does anyone have any thoughts?

A: 

could you post your log4net configuration? maybe it´s a configuration issue.

Joachim Kerschbaumer
A: 

i don't think so because same config is used in a working app

but here it is

what user does log4net uses when writing to disk?! Is there any need to add permissions to write to log folders? Because i use impersonate=true the user logged to the site is the one that log4net is using to write to file system right?!

  <!-- log4net -->
  <log4net debug="false">
    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="D:\\WSBank\\Solution\\Logs\\Solution.log" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="1024KB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="RollingFileAppender" />
    </root>
  </log4net>
+1  A: 

After all it was a permission issue setting the write permission to everyone log4net started logging well as it uses the current logged user account

regards