Logging strategy vs. performance
- by vtortola
Hi,
I'm developing a web application that has to support lots of simultaneous requests, and I'd like to keep it fast enough. I have now to implement a logging strategy, I'm gonna use log4net, but ... what and how should I log? I mean:
How logging impacts in performance? is it possible/recomendable logging using async calls?
Is better use a text file or a database? Is it possible to do it conditional? for example, default log to the database, and if it fails, the switch to a text file.
What about multithreading? should I care about synchronization when I use log4net? or it's thread safe out of the box?
In the requirements appear that the application should cache a couple of things per request, and I'm afraid of the performance impact of that.
Cheers.