Reputation: 55022
I have a seperate Log4Net.config file. I added
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]
to AssemblyInfo.cs
When I run the application with debug mode, lognet is logging. When i publish the application to IIS, lognet is not logging anything.
I have the followings also :
BasicConfigurator.Configure(); // in a method
private static readonly ILog _logger = LogManager.GetLogger(typeof(_Default)); // for the instance
What would be the reason for this?
Upvotes: 3
Views: 2537
Reputation: 88345
It could be that the AppPool identity user does not have permissions to write to the log file/directory (assuming you're using a file appender).
Here's how to check the AppPool user account:
If that's not the problem, I'd recommend turning on the log4net internal debugging:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
</configuration>
Upvotes: 6