net-commons / common-logging

A portable logging abstraction for .NET
http://net-commons.github.io/common-logging
Apache License 2.0
649 stars 205 forks source link

Checking for a logger existance #156

Open gabriele-ricci-kyklos opened 7 years ago

gabriele-ricci-kyklos commented 7 years ago

Hi, I use Common.Logging in a few projects with log4net and I was wondering how can I understand if a logger has been declared. In the class LogManager of log4net there is the method Exists, but I found none in the LogManager class of Common.Logging. This would be useful because I have configured a root logger, and I wish to write logs in a specific logger only if it is configured, and using LogManager.GetLogger(string) gives me the root logger if the string is not a valid logger How can I achieve that?