How do i log something in meteor?

随声附和 提交于 2019-12-18 13:05:27

问题


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

or even node-loggly


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/10166778/how-do-i-log-something-in-meteor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!