开发者

How to implement a sample log4net repository

开发者 https://www.devze.com 2022-12-14 11:53 出处:网络
How do I implement a custom LOG4NET parser for my XML file. My XML file contains: (1) extra attributes on the appender element

How do I implement a custom LOG4NET parser for my XML file. My XML file contains:

(1) extra attributes on the appender element

(2) custom replacements on the elements of some of the appenders that need to be set at runtime.

For example:

<appender name=... type=... mode="something">

<some-property-of-appender>${MyValueForThisPropertyFromDB}</some-property-of-appender>

</appender>

I have read that I am supposed to imple开发者_如何学Goment a Custom Repository probably using the LoggerRepositorySkeleton but not sure how to put this whole thing together. Any suggestions?


Since you are trying to initialize most of the log4net configuration from database the easiest way would be to configure log4net from code. Then you will have full control over what parameter values you use and where they come from.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号