cpsgroup / sarapis

A RESTful, proxied, read-only Solr interface
http://sarapis.herokuapp.com
MIT License
1 stars 2 forks source link

Refactor log configuration #6

Open vyo opened 9 years ago

vyo commented 9 years ago

what do you think @MartinLichtblau?

MartinLichtblau commented 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?

vyo commented 9 years ago

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.

MartinLichtblau commented 9 years ago

Concerning the Rolling Logger >> https://github.com/trentm/node-bunyan/issues/33

vyo commented 9 years ago

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?

MartinLichtblau commented 9 years ago

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!

MartinLichtblau commented 9 years ago

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.

vyo commented 9 years ago

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.

MartinLichtblau commented 9 years ago

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?