4 ms·
Our approach is to accumulate logs on the grain of individual user work items - one SQLite database per. This has several benefits, the largest of which being
by bob1029 5y ago
Our approach is to accumulate logs on the grain of individual user work items - one SQLite database per.
This has several benefits, the largest of which being that you only look at log files when a thing logically goes wrong, and every entry you see pertains to that exact activity.
The other benefit is that these logs get purged at the same grain as the work items being cleaned up. Successful items are purged quickly, exception items can be kept perpetually.
So, the implication for us is to log with a lot of verbosity with the expectation that we are probably never going to see any of it, but also with the knowledge that a ton of helpful debug lines will be available when it does all go wrong. Stack traces are not enough for us, we need to know exactly what communications occurred between us and external systems over time to figure out many issues.
We do maintain a global log file, but this is mostly just service start/stop entries and other administrative actions.
- shadowgovt 5y agoThis basic philosophy looks very similar to Google's Dapper request tracing system. Since it's impossible to log every request at their scale, they have various scaling controls for dropping requests from the trace or summarizing them (which can be overridden when a trace goes exceptional).