views:

283

answers:

1

Hi

I'm writing an .NET 3.5 web application that is using LinqToSql for the basic database stuff. I'd like to use the nLog library for logging. This library can log to a database using good ol' fashioned stored procedures (not that there is anything wrong with that..) but I'd like to use the LingToSql DataContext to log to the database

Does anyone know how to do this? I am aware version 2.0 of nLog is coming, but it's not here yet...

-Edoode

+2  A: 

Write your own target in NLog

If you wish to use LINQ to do it, then create your own target to write to. I don't see why if you have SProcs though, the fastest possible way to write messages using C# to a database (bar a bulk load) is via the native SQL api and calling a stored proc. Plus if someone has already written a DB target for you...

Spence