4 ms·
A better idea may be to not log to file. If you were to log to a database you could record things like date/time, session_id, service_name, module_name, and a
by cconstantine 18y ago
A better idea may be to not log to file. If you were to log to a database you could record things like date/time, session_id, service_name, module_name, and a generic message and do clever SELECTs on your database of events/messages and it would be easier to answer questions like 'Is this exception clustered with time?' or 'is module X ever called in a session that results in an error between noon and 1pm?'
Cleaning old messages is potentially easier as you can remove lower priority messages first, or simply delete any message older than X.
Of course, if you're logging to another remote service (like a DB server), how do you record low level events in communicating with that service, or how do you record events when the db server is down?
- joestrickler 18y agoLog critical/connectivity errors to a local disk.