Wednesday, March 16, 2011

How do I log to a table in SQL Server 2000?

I'm writing into a log file, but I want to log into a table named "Log" in my database.

How can I accomplish this?

From stackoverflow
  • Check out logging.apache.org for the log4X that fits the language you are using. I know they have log4j (Java) and log4net (C#/.Net). They also have examples on how to configure the logging framework to log to a database table instead of a file.

  • log4net has an AdoNetAppender, and a sample configuration right here.

    Stuart Helwig : The huge advantage of using log4net too, is that you can switch between logging to your SQL server, and any other method you like (files, event log...whatever) by simply altering your config file.

0 comments:

Post a Comment