Monica
Monica

Reputation: 223

Removing log4net.config file does not stop the logging for a WCF application

I have a WCF application hosted under IIS 7 and I've enabled log4net for it. I'm using a separate log4net.config file because I would like to make it very easy to enable/disable the logging, without changing web.config. By dropping the log4net.config file in a specified path, my WCF application starts logging into a file. But if I remove the log4net.config file the application continues to log. It seems that for removing the logging option I always have to restart the application pool manually.

Is there any other way to disable the log4net logging without having to restart the IIS application pool or to add configuration to web.config?

Thank you.

Upvotes: 0

Views: 240

Answers (1)

sgmoore
sgmoore

Reputation: 16077

If your logging starts when the file gets created, then your application must be monitoring it, which would suggest that all you need to do is edit your log4net.config and change the logging level to off.

Upvotes: 1

Related Questions