4

I'm using bunyan to send logs to Google Cloud Logger. Regular logs are not show up there. Or they do show up but as one-liners. If a regular consonle.log will be logging an object, then each property of this object will be displayed as a separated line, which is really hard to read.

The bunyan let me output only the title as the log for Google Cloud Logger and if I pass an object, then this object will be displayed as the log payload, which is good and easy to read.

I'm using a 3rd party npm package. It outputs it's own console.logs. How do I make bunyan to intercept those logs?

stkvtflw
  • 12,092
  • 26
  • 78
  • 155
  • I have found this [documentation](https://cloud.google.com/logging/docs/setup/nodejs) about Setting Up Cloud Logging for Node.js, that might help you answer your questions. – Aarti S Oct 08 '20 at 19:11
  • this is exactly what I do. The problem is that 3rd party libs are not using this setup. – stkvtflw Oct 09 '20 at 10:34
  • this [information](https://github.com/trentm/node-bunyan/wiki/Awesome-Bunyan) may be useful – gowridev Oct 20 '20 at 12:50
  • @stkvtflw did you find a solution? Did you try monkey patching console.log? – alexsanzdev Dec 11 '20 at 12:19

0 Answers0