Strider-CD / strider

Open Source Continuous Integration & Deployment Server
http://strider-cd.github.io/
4.6k stars 431 forks source link

Move logging to a asycronous JSON logger, i.e bunyan #301

Open tomgco opened 10 years ago

tomgco commented 10 years ago

Instead of littering the sourcecode with console.{logs, errors} which are Syncronous I propose moving to use a JSON logger like bunyan.

One which I have used in production is bunyan: https://github.com/trentm/node-bunyan

“Bunyan is a simple and fast JSON logging library for node.js services”

niallo commented 10 years ago

We had some discussion around this in #134

jaredly commented 10 years ago

+1 let's do it

wilmoore commented 10 years ago

You might also consider using an event emitter to facilitate logging. The following slide-deck has a pretty good example of this in action: http://michaelbrooks.ca/deck/2013-node-brigade/#/62.

BTW, since switching to this pattern in a large app, life has been all kinds of better. We have lots of sub-apps that should comply with the overall logging strategy which is configurable from the app and from the developer's perspective. Emitting async events helps a lot.

I suspect this pattern would be useful for plugin development as well.

jaredly commented 10 years ago

Thanks for the link! @niallo what do you think of that? Just post messages to the global eventemitter?

On Fri, Jan 24, 2014 at 10:46 PM, Wil Moore III notifications@github.comwrote:

You might also consider using an event emitter to facilitate logging. The following slide-deck has a pretty good example of this in action: http://michaelbrooks.ca/deck/2013-node-brigade/#/62

— Reply to this email directly or view it on GitHubhttps://github.com/Strider-CD/strider/issues/301#issuecomment-33281896 .