Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of Log4net Conversion Patterns

Is there a comprehensive list of all the conversion patterns available for log4net? I can't even find them in the source code.

All I have found is this; shouldn't there be more patterns? For example, how would I get the name of the hosting application?

Also, how can I add my own patterns?

As an example here is the comparable list but for nlog.

Edit: I have found the Pattern for application name; it's [Application]. But I'm still looking for the mother-load. Can someone at least point me to the class in the source that manages these? Maybe I could find the list from that.

like image 960
kay.one Avatar asked Jul 09 '09 05:07

kay.one


2 Answers

The Remarks section of the log4net.Layout.PatternLayout class in the Apache Log4Net SDK documentation looks to have what we want:

http://logging.apache.org/log4net/release/sdk/?topic=html/T_log4net_Layout_PatternLayout.htm

like image 72
Rae Avatar answered Oct 03 '22 00:10

Rae


Looks like that link is Dead.

I found it in the Waybacktimemachine and posted it to my blog.

http://spoiledtechie.com/post/2015/11/19/Conversion-Patterns-for-Log4Net.aspx

It might be too much to post here on SO. If I am wrong, I will happily post here if everyone agrees that its not too bad.

like image 35
SpoiledTechie.com Avatar answered Oct 02 '22 22:10

SpoiledTechie.com