logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Mauer <gma...@gmail.com>
Subject Re: How to dynamically query and set logger levels?
Date Wed, 04 Dec 2013 20:16:54 GMT
I've posted this on Stackoverflow if anyone wants to answer it on there for
SO rep..<http://stackoverflow.com/questions/20384888/query-and-modify-log4net-logger-levels-from-code>

I would like to create an area in my application that will let sysadmins
modify logger levels directly.

This stackoverflow answer from 2009
<http://stackoverflow.com/a/738239/5056> implies
that I can do it with

foreach (ILog logger in log4net.LogManager.GetCurrentLoggers()){
  ((log4net.Repository.Hierarchy.Logger)logger).Level =
      log4net.Core.Level.Error;}


My application uses log4net 2.0.3
(1.2.13)<https://www.nuget.org/packages/log4net/>and this seems to not
be available as no implementation of ILog inherits
that class.

Instead I can grab each ILog's instances of ILogger to give me the name but
will not let me query or set the Level. There is nothing I can cast this to
in the meantime as it seems to be implemented by an internal class.

PS. How exactly does the email confirmation protect me from someone
subscribing falsely? I subscribed by emailing from this address!

Mime
View raw message