質問

I am using ServiceStack logger and need to know if my logger is properly initialized or not. When I call LogManager.GetLogger(...) there is no way to know if the call was successful or not. If app.config contains error logger will not be initialized and my code will not have any idea about it. Is there any way to check whether logger is properly initialized or not ?

役に立ちましたか?

解決

You can see if there are any appender initialized:

  LogManager.GetRepository().GetAppenders().Count();

The Log4net logging itself (i.e. the logging methods) are by designed to fail silently. They should not interact with your program.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top