View Full Version : How do I turn off log4net...
02-23-2006, 10:00 PM
Love the code but I need my debug messages not Spring's! Right now it is taking some 55 seconds for Spring to do our dependency injection.
Granted we are pretty hardcore and we dont see it in a release version, or even debug if a debugger is not attached, but I do need to be able to debug my stuff.
By and by becuase log4net writes to standard out you can't just remove the startup code becuase it finds standard out when it is hosted inside the IDE...
02-24-2006, 01:22 AM
What type of application are you building and how are you configuring log4net?
If you want to disable it completely you can just comment out the Log4NetConfigFile key in the main configuration file. If you want to use log4net, but don't want to see Spring debig messages, simply change logger definition in log4net config file from:
<level value="DEBUG" />
<level value="WARN (or ERROR)" />
Or remove it completely, if you don't want to see any Spring messages.
02-24-2006, 02:08 PM
I agree that this is how to turn log4net off...in theory.
However, and this might be more of a log4net question, taking out the log4net stuff does not seem to disable the messages from showing up in the output window of the IDE. Since we inject 1000's of lines of code we are getting these messages to the output window of the IDE for appox. 55 seconds. I am wondering if these are log4net, which I am assuming since it it for logging, and how to stop them from happening... I dont want to close the output window because I do have some valid stuff of mine that I want to see. (In fact I just tested that and closing the output windows does not work becuase it is still reading the stream in the background).
An example of a message is this:
47895  DEBUG Spring.Objects.Factory.Support.AbstractObjectFacto ry (null) - Returning cached instance of singleton object 'zzz'.
We don't have a log file just 1000's of lines of this stuff in the output window!
02-24-2006, 03:04 PM
i already got this problem once when i was using this line to configure log4net :
I changed it to
and the theory became a reality.
02-24-2006, 03:35 PM
Thanks so much!
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.