We use Enterprise Library 4.1 for logging (and exception handling / cryptography).
Does anyone know a good way to determine the configured logging level at runtime? I wrote the LogUtility class to make registration calls and call it according to this example:
LogUtility.LogVerbose( string.Format("Processing event {0}", currentEvent.EventIDImported), MethodBase.GetCurrentMethod().Name, this.GetType().Name );
I understand that it will not actually be registered to the file if the registration level is not set to the appropriate level in app.config in my case. But I really do not need the parameters of the method, that is, the names of the methods and types, and in some cases the actual lines that are registered should be evaluated if absolutely necessary.
Does this sound like a valid problem? Our application can have tens of millions of iterations and registration points. If possible, I would like to set a flag based on the configured log level and check this before calling the method call above.
EDIT. I think in terms of the above example, I can use the method and type names for each call. But I still would like to know if there is a way to determine the level.
source share