I am configuring the library through the
log4net.Config.XmlConfigurator(ConfigFile
= "log4net.config") attribute. I would like to check programmatically if
configuration succeeded or failed (e.g. due to missing or malformed log4net
.config).

.NET 6, single assembly.

FAQ demonstrates the following example:

log4net.LogManager.GetRepository().Configured

(https://logging.apache.org/log4net
/release/faq.html#How_can_I_evaluate_configuration_errors_at_runtime).

But the method looks obsolete since the recent API does not have a
parameterless method GetRepository() and
log4net.LogManager.GetAllRepositories()
returns an empty list, even if successfully configured.

How can I check if configuration was successful (defined as there are some
appenders configured)?

Thank you,
Regards

Reply via email to