I am using log4net and a customized AdoNetAppender to log error messages into a database.
Is it really a good idea to set the buffer size to 10, 20 or maybe even 100 for logging?
I know that it’s good for performance, because this way not every error will trigger a DB query and when many errors occur at once, this may even kill my server, but
It makes immediate error analysis kind of hard, if I have to wait until 99 more errors occur, until I can access the error information in the DB.
Am I missing something? What is the way to go regarding buffering error messages?
Probably the difference is philosophical and some people would say to only do batch inserts with lots of data every now and then.
we actually write immediately to a log file exactly to be able to debug immediately and not have to wait until 99 more errors come.
you can eventually have a mixed approach, to log (text) files immediately and to database every 100 records…