Josh
Josh

Reputation: 2339

Log assembly version with log4net?

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

Upvotes: 6

Views: 3100

Answers (1)

Stefan Egli
Stefan Egli

Reputation: 17028

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)?

Upvotes: 6

Related Questions