Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to completely disable log4net

Tags:

.net

log4net

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.

like image 898
Nas Avatar asked Jan 31 '13 08:01

Nas


People also ask

Is log4net same as log4j?

log4net is a port of the excellent Apache log4j™ framework to the Microsoft® . NET runtime. We have kept the framework similar in spirit to the original log4j while taking advantage of new features in the . NET runtime.

Where is log4net configuration file?

You can configure the log4net. config file to create log files. The file is located in the webroot\App_data directory of the installation.

What is log4net DLL?

dll in Solution. Log4net is an open-source project based on the work of many authors. It allows the developer to control what log statements are output with arbitrary granularity. It is fully configurable at runtime using external configuration files.


2 Answers

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

like image 142
mamoo Avatar answered Sep 21 '22 13:09

mamoo


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?

like image 35
Vishal Suthar Avatar answered Sep 19 '22 13:09

Vishal Suthar