How do i log something in meteor?

后端 未结 3 2028
情歌与酒
情歌与酒 2020-12-31 07:36

Can I use something like winston npm in the underlying .meteor/local/build/server/node_modules?

or even node-loggly

相关标签:
3条回答
  • 2020-12-31 07:51

    You can use winston (nodejs logging module) with meteor. And it does support several transports including, loggly, mongo and so many others.

    See my article on how to integrate it

    0 讨论(0)
  • 2020-12-31 08:10

    The good old Observatory has been revamped and works with Meteor 0.9+ now. Details, usage, demo app via http://observatoryjs.com

    See also pince, a lightweight logger for Node and Meteor (client/server).

    Another interesting logging package is trail, which has configurable transports (console, MongoDB, custom), and can centralize logs from the server and multiple clients, and display them in an admin interface, trail-monitor.

    0 讨论(0)
  • 2020-12-31 08:16

    There is a package called logging however in the comments it mentions it is just temporary. It exposes a method called Meteor._debug which basically uses console.log which works both serverside and also client side. So it might work better to use that for now.

    You could however use some other logging plugin if you like, either put it in a package or use the npm's or include the javascript in your template for logging.

    0 讨论(0)
提交回复
热议问题