logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Green" <James.Gr...@occam-dm.com>
Subject RE: Event Log Weirdness.
Date Fri, 19 Jun 2009 10:24:26 GMT
Do you call ActivateOptions() when Threshold property is changed?
Radovan

Indeed I do ...

        public static void LogToEventLog(bool logToEventLog)
        {
            if (_eventLogAppender == null)
                return;

            if (logToEventLog)
            {
                _eventLogAppender.Threshold = Level.All;
            }
            else
            {
                _eventLogAppender.Threshold = Level.Off;
            }
            _eventLogAppender.ActivateOptions();
        }

This is being shown in my console window:

log4net: EventLogAppender: Changing event source [MyFirstApp] from log
[Applicat
ion] to log [log4net]
log4net: EventLogAppender: Source [MyFirstApp] is registered to log
[log4net]





Mime
View raw message