I have a C# console application project which uses log4net as the logging library. Throughout the application there are logging statements (log.Debug()
, log.Error()
, etc.), which are printed to the console as the program runs.
What is the best way to change the logging statements in a production environment, to minimize time of execution caused by logging? I would like some of the statements to not print out at all, and for some logging statements to only be printed out during production.
I am thinking of adding new setting in the Web.config
file which determines how the logging changes. However I think I'd also need to override the log.Debug()
and log.Error()
methods to work with the new setting, but am unsure how to do this. Can anyone advise?