Click here to Skip to main content
15,914,071 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hiya

I am currently logging my errors using the Log4NET logging tool. The code works on the local machine, yet when I transfer it to the host server, the files are not logging.

The configuration I am using for Log4NET is below:

HTML
<configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
  <log4net>
    <appender name="FileAppender" type="log4net.Appender.FileAppender">
      <param name="File" value="Log4Net.log" />
      <param name="AppendToFile" value="true"/>
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
      </layout>
    </appender>

    <root>
      <level value="All" />
      <appender-ref ref="FileAppender" />
    </root>
  </log4net>


I have set it up using the tutorial found at this site

Can anyone offer any guidance. It works with IIS, just not on the main site.

Thanks in advance!
Posted
Comments
ZurdoDev 28-Feb-12 9:45am    
Is Log4Net installed on the hosting server or are you copying its dlls? You likely need to check with your hoster.
Scrappy 1871 28-Feb-12 9:53am    
I'm copying the dlls.

1 solution

Make sure the file / directory Log4Net is logging to is writeable for the user that uses the logging and point Log4Net to the full path. You could try it to make you're c:\temp folder read/write accessible for everyone and change the web.config to
<param name="File" value="c:\temp\Log4Net.log" />


Regards
Piet
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900