Have log4net use application config file for configuration data

前端 未结 5 1163
北恋
北恋 2020-12-23 19:34

I would like to store log4net config data in my application.config file. Based on my understanding of the documentation, I did the following:

  1. Add a referenc

5条回答
  •  天命终不由人
    2020-12-23 20:02

    All appender names must be reflected in the root section.
    In your case the appender name is EventLogAppender but in the section it is named as ConsoleAppender. They need to match.

    You can add multiple appenders to your log config but you need to register each of them in the section.

    
    
    

    You can also refer to the apache documentation on configuring log4net.

提交回复
热议问题