I would like to be able to log events from within an appender.  I've always 
been surprised there isn't more support for this. Obviously to avoid 
re-entrancy, an appender must ignore events it generated itself, and should not 
generate events before log4net has been successfully configured.

>From within DoAppend, there is a flag m_recursiveGuard which should prevent 
>re-entrancy problems from a synchronous appender's Append method.  For an 
>asynchronous appender there would need to be an additional check since it will 
>want to log from a different thread.

The following commit will give you an idea of what I'm thinking of:

https://github.com/apache/log4net/commit/9dc3ed9ae079d9abeacdf86c380b17efff4b3a97?w=1

Is this something we should support?
Or is there some gotcha I'm missing?

BTW if you look at the above commit without the ?w=1 suffix, you'll see 
whitespace differences in the Flush method.   I think the .gitattributes file 
needs to add rules for converting spaces to tabs.

Reply via email to