Is there any way to look into a message with C # code in log4net?

I need to find a way to configure log4net in code (C #) at the global application level, so that every time a particular line is displayed in a registered message (all levels or one selected level), an action delegate is called. This is apparently a pretty basic feature, but so far I have not been able to find any results.

Thank you Radek

+4
source share
1 answer

Unable to "peek". Use the optional appender - MemoryAppender .
And use its GetEvents method to periodically check all registered messages, and if you find the corresponding message, post some event, etc.

+2
source

Source: https://habr.com/ru/post/1680401/


All Articles