logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Taylor <JUS...@lorencook.com>
Subject RE: Adjust log4net logging severity
Date Wed, 06 Apr 2016 14:46:21 GMT
Door #2.  I'll check out XmlConfigurator.Configure.


Thanks

From: Joe [mailto:JocularJoe@hotmail.com]
Sent: Tuesday, April 05, 2016 3:48 PM
To: Log4NET User <log4net-user@logging.apache.org>
Subject: RE: Adjust log4net logging severity

Not sure I fully understand all your requirements but:


-          If you want your users to be able to dynamically change the logging level while
the application is running, then revert to the configured values when the application exits,
you can use the techniques described here: http://stackoverflow.com/questions/738126/dynamically-reconfigure-log4net


-          If you want to be able to store a user-specific configuration file on disk, then
(a) yes, somewhere application-specific under %appdata% would be reasonable (roaming application
data); (b) in this case, call XmlConfigurator.Configure rather than using the ConfigFile attribute
or <appSettings>.

From: Justin Taylor [mailto:JUSTIN@lorencook.com]
Sent: 05 April 2016 22:19
To: log4net-user@logging.apache.org<mailto:log4net-user@logging.apache.org>
Subject: Adjust log4net logging severity

I'm working on a .NET Windows app, and I need the ability for the user to change the logging
severity from within the app.  Right now, I have the logging severity set in my .config file,
but that lives under Program Files so the user can't modify that file.    I looked at the
ConfigFile attribute and the <appSettings> keys to move the location of the configuration
file.  I have Terminal Server users, so I'd really need to put the config somewhere user specific.
 I think under %appData% would be best, but I can't get the ConfigFile attribute or <appSettings>
to work with that.

Is there a way to point the config to %appData%?  Is there a better way to change logging
severity?


Thanks

Mime
View raw message