logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Radovan Raszka" <ras...@hasam.cz>
Subject RE: Hi all
Date Tue, 11 May 2010 10:08:48 GMT
Try appender.ActivateOptions(), but I'm nor sure if it helps as you call Configure after setting
up the appender

R 

-----Původní zpráva-----
Od: Aleš Vojáček [mailto:algidovo@gmail.com] 
Odesláno: 11. května 2010 11:10
Komu: log4net-user@logging.apache.org
Předmět: Hi all

I have some problems with set up IsDebugEnabled to false by code.

            var appender = new ConsoleAppender();
            appender.Layout = new log4net.Layout.PatternLayout("%date
[%thread] %-5level %type %logger - %message%newline");
            appender.Threshold = Level.Info;

            log4net.Filter.DenyAllFilter f = new DenyAllFilter();
            appender.AddFilter(f);

            log4net.Filter.LevelRangeFilter filter = new log4net.Filter.LevelRangeFilter();
            filter.LevelMin = Level.Info;
            filter.LevelMax = Level.Fatal;
            appender.AddFilter(filter);
            log4net.Config.BasicConfigurator.Configure(appender);
            var logger = log4net.LogManager.GetLogger("Main");


logger.IsDebugEnabled is still set to true :-(

Can someone help me with that?
A.

Mime
View raw message