This is the simplest possible way I could think to add useful logging. After every request, write the timestamp, parameters, and result to /var/log/binplz/requests.log as a JSON record. A logrotate service compresses and timestamps the file as soon as it grows over 16 MB. I didn't know about logrotate, but it's pretty much exactly what I think we want, at least for now.
it doesn't rely on third-party services
it has compression
it's easy to pass to other tools for analysis
In the future, we could
Sync rotated logs to S3
Log every request, not just those to build endpoints, by sitting at the Application level
Provide structured Haskell types for log entries to facilitate parsing
I tried my hand at some of these, but I think there's value in first talking about this simple approach, and then seeing where to take it.
This is the simplest possible way I could think to add useful logging. After every request, write the timestamp, parameters, and result to
/var/log/binplz/requests.log
as a JSON record. A logrotate service compresses and timestamps the file as soon as it grows over 16 MB. I didn't know about logrotate, but it's pretty much exactly what I think we want, at least for now.In the future, we could
Application
levelI tried my hand at some of these, but I think there's value in first talking about this simple approach, and then seeing where to take it.