Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log assembly version with log4net?

Tags:

c#

log4net

I am using the log4net.Appender.AdoNetAppender. Is there a way to add the assembly version to each entry?

like image 767
Josh Avatar asked Feb 24 '11 22:02

Josh


1 Answers

You can use thread or global context for this purpose. Have a look at this tutorial.

To answer your question better I need to know a bit more details: The version of which assembly do you want to log? Just the version of the executable (simple: just add it to the global context) or of the assembly that contains the code that logs (requires a bit more effort)?

like image 129
Stefan Egli Avatar answered Oct 13 '22 11:10

Stefan Egli