Ability to programmatically remove a Logger
log4net
Solution
Wrapping this up since it has been open a long time. I haven't found a way to remove a logger by itself and nothing I've seen in the documentation suggests it is possible either. The solution that worked for me to share a pool of loggers that would only grow to the max amount of concurrent tasks. Each task could take a logger from the pool with an appender added specific to that task. On task completion, the appender is removed and the logger returned to the pool.
Problem
Is there a way to remove a `Logger` once it has been added? Say via: ``` LogManager.GetLogger("loggerName") ``` In my research, it would appear it is not possible. The closest I have found is the ability to call the `Clear` hierarchy method. This will indeed clear out the existing loggers but I would like to selectively remove them, not to mention this likely isn't the safest thing to be doing. For some background, I am logging one file per task where there could be potentially thousands of concurrent tasks and hundreds of thousands of tasks per application lifetime. One approach is to create a `Logger` for each task and then remove it once the task has completed. Without the ability to selectively remove a `Logger` though, memory will get chewed up by the retired instances. Of course, there are alternative designs that would work. The problem could be addressed by adding/removing `Appenders` and `Filters` as necessary to a given `Logger`. Also, a pool of `Loggers` and `Appenders` could be created and then configured per task. It obviously isn't a show stopper if there is no way to remove a specific logger once it is added. I'm just curious if there is a way to delete a `Logger` that I may have missed?