View Full Version : what is the proper way to disable spring.net logging?
03-04-2005, 06:39 PM
If I would like to temporarily disable spring.net logging, what is the proper way to modify my log4net config file?
03-05-2005, 05:12 PM
There are many ways to configure log4net, refer to the log4net manual (http://logging.apache.org/log4net/release/manual/configuration.html) or a an OnDotNet (http://www.ondotnet.com/pub/a/dotnet/2003/06/16/log4net.html) article for the more details.
A simple recipe you can use is in your .NET application configuration file add a log4net custom configuration section handler
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<conversionPattern value="%d [%t] %-5p %c - %m%n"/>
<level value="WARN" />
<appender-ref ref="ConsoleAppender" />
Depending on how much you really want to suppress log4net you can set the level to WARN, ERROR, FATAL or OFF. I'd recommend setting it to WARN or ERROR.
You then enable the logging either by putting the following attribute in the assembly
and making a standard log4net logging call somewhere during the app startup before the spring assemblies have been loaded or instead configure explicity using
05-06-2005, 02:20 PM
Thanks, but I only want to disable Spring.NET logging, not all logging.
<level value="OFF" />
but that doesn't seem to work.
05-06-2005, 02:59 PM
The .* is implied so just add
I'd recommend not turning it off completely but keeping it at the warning or error level.
05-13-2005, 08:27 PM
This is really just a general .NET configuration question. I downloaded the current log4net version which breaks my build because Spring.NET is using an older version. What is the proper way to make my application (using an updated log4net) co-exist with Spring (using the older version of log4net)?
05-14-2005, 04:03 PM
There is some info about this on the log4net mailing listhere (http://marc.theaimsgroup.com/?l=log4net-user&m=111367361428762&w=3).
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.