Does anybody have any advice on how to minimize my logs for a web application?
Right now, I’m logging every error. So if there is a situation where an error occurs on every request (a db connection problem for example), it might get logged for every user on every request. As you can imagine, it doesn’t take too many users doing too many things to start amassing a huge log file with redundant log errors.
It has occurred to me to create some type of flagging mechanism to not log the same error within N minutes. I don’t like this for 2 reason; 1) it could hide the most significant problem amongst the others and 2) cascading errors may not log their error trail properly, omitting previously logged errors, potentially throwing off my initial diagnosis.
I’m sure I’m not the first person to have this issue … does anybody have any advice on how to reduce redundant log messages for a web-app?
I’ve combined it with my user error message, so when the error message is shown the user, they can either click, OK or Send to Support. Then the complete error, call stack, & complete request information is entered into the bug tracker.
This hasn’t been released yet, so we’ve yet to see if this is a good idea … will keep you posted.
PS-I’ve answered my own question as a for the record, and selected it since the other answers did not meet my needs.