binplz / binplz.dev

binplz.dev
https://binplz.dev
5 stars 1 forks source link

Add simple logrotate-based logging #42

Closed jonascarpay closed 2 years ago

jonascarpay commented 2 years ago

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

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.