Hi I have created a custom log4net appender and I can get the appender to work in a console application. However when I try and use the appender in a MVC web app or even in an ASP.NET web app it fails to run the appender.
The log4net config is in a separate file.
Here is the config:
<appender name="AsynchronousLog4NetAppender" type="Custom.ErrorLogger.CustomErrorLogger, CustomErrorLogger">
<file value="App_Data\Logs\Trace.%property{log4net:HostName}.log" type="log4net.Util.PatternString" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
<encoding value="utf-8" />
</appender>
I have made sure that the IIS user has full control on the directory and still does not work. If I use a standard appender everything works. I have checked this post (log4net with ASP.NET MVC: nothing happens).
TIA
Graham Harris