Open vyo opened 9 years ago
Didn't receive a notification. Will look into it and push my results today or tomorrow. @vyo With rolling loggers you mena a log mechanismn which creates a persistent log every day?
Yes, exactly. We don't want the logs to grow too ginormous over time. Looking forward to your PR! Any thoughts on bunyan, btw? Looks very sleek.
Concerning the Rolling Logger >> https://github.com/trentm/node-bunyan/issues/33
Just reconfigured our two loggers (cli and rest) to both log to './sarapis.log', quick and easy. I am not quite happy, yet, though. Naming is opaque (sarapis.log.0, sarapis.log.1,...) and does not support putting date information in the file name itself; which I find makes it far less useful. Plus, rotation size is fixed, so that for count:=10 you only ever have log history for 10 days.
We might address that by adding some sort of scheduler: https://www.npmjs.com/package/hapi-agenda comes to mind. That is, we use bunyan's log rotation (for, say 3 days) and rename old logs every day at 1AM or so.
Any suggestions, @MartinLichtblau?
Yes, fixed naming and rotation count is a real drawback. The scheduler in combination with the rotation should work, so that's the way to go!
Mhh, the bunjan-rolling-logger works out of the box. The hapi-agenda-scheduler is also easy to include, but I just realized that it requires a mongodb server. Don't know why, but it's kind of an overkill for our purpose, on the other hand it could be used to spawn jobs of all kinds from within the admin-page.
What a bummer... the db dependency ain't worth it. I'd say we roll with the rotating logs and look for a lightweight scheduler after that. Will open a new issue for that.
On Wed, 8 Jul 2015 16:32 MartinLichtblau notifications@github.com wrote:
Mhh, the bunjan-rolling-logger works out of the box. The hapi-agenda-scheduler is also easy to include, but I just realized that it requires a mongodb server. Don't know why, but it's kind of an overkill for our purpose, on the other hand it could be used to spawn jobs of all kinds from within the admin-page.
— Reply to this email directly or view it on GitHub https://github.com/cpsgroup/sarapis/issues/6#issuecomment-119599962.
I was lucky and found a hint on stackoverflow that this feature is already implemented in bunyan. I our hapi-bunyan it is not, in the node-bunyan it is a pending PR. So perhaps this will be added in future releases?
what do you think @MartinLichtblau?