Extending Logger

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Extending Logger

I am using NLog 2.0 and logging to a SQLite database for a ASP.net application.

I have a class that has a method that sets a couple of session variables with some application specific data. I then log that information using the <Level> (string, params [] object) methods. I know, it's not the most elegant solution, but unfortunately we are trying to implement logging as an afterthought to an old application without having to add a lot of lines of code.

We would like to extend the Logger *Exception methods so that it accepts a string as an argument in addition to the message argument. How would I go about doing that?

We would like to use a *Exception(string, exception, params [] object) pattern.

Thank you in advance