How to completely disable log4net

19,815

Solution 1

to disable all logging messages you can set Logging level to OFF:

Setting the Threshold on the Hierarchy to Level OFF will disable all logging from that Hierarchy. This can be done in the log4net configuration file by setting the "threshold" attribute on the log4net configuration element to "OFF". For example:

<log4net threshold="OFF" />

http://logging.apache.org/log4net/release/faq.html

Solution 2

Setting the Threshold on the Hierarchy to Level OFF will disable all logging from that Hierarchy. This can be done in the log4net configuration file by setting the "threshold" attribute on the log4net configuration element to "OFF". For example:

<log4net threshold="OFF" />

Refer this: How do I completely disable all logging at runtime?

Share:
19,815

Related videos on Youtube

Nas
Author by

Nas

Updated on September 15, 2022

Comments

  • Nas
    Nas over 1 year

    I have a log4net in one .net web application. But i want to completely disable it. Is there any configuration setting that can be set in the web.config in order to achieve this.