HOWTO: Adding custom listeners at runtime

May 9, 2008 at 1:35 AM
Perhaps I am missing something, but I can't seem to find an easy way to add a custom listener at runtime without having to use reflection and substituting a private static Logger.writer at runtime. I assume there must be a way to change the factory or inject a custom configuration source at runtime.

Why do you ask I cannot configure my listener in the app config file? Because my application is extremely dynamic and new modules are being added to it by simiply dropping add-in assemblies into a predestinated folder. (Yes, we do use .NET 3.5 add-ins) I cannot impose a requirement on add-in developers to modify the app config file.

My web search didn't turn up any relevant code samples or explanations, but I am certain that I am not the first one to ask this question.

Any help on this issue will be much appreciated.