I have few different web services exposed by my web site. Here is a goals I want to reach:
- Store all data in DB in one table;
- Each record should have text field with ‘service/component’ name;
- It is necessary to store all income parameters when any method is called;
- It is necessary to store all outcome parameters AND error messages if any exception is occurred.
My original intention was to use log4net. But from these walk-through (http://sadi02.wordpress.com/2008/09/15/how-to-store-log-in-database-using-log4net/, http://logging.apache.org/log4net/release/config-examples.html) I don’t see an easy way to add custom data into log table.
Is it feasible to use log4net for such purposes? How can I change logging table schema to store custom data? Should I modify source code of log4net library? Probably would be better to write a custom functionality to store such kind of data?
Thanks.
Neither of suggested answers works for me. The problem is that I need to have several custom fields. For me it seems too complicated to create different instances of logger or to setup column values each time through the ‘properties’.
I will go (actually, already implemented) custom logger that put data in DB.