bunyan-elasticsearch icon indicating copy to clipboard operation
bunyan-elasticsearch copied to clipboard

Get rid of JSON.parse

Open jwalton opened this issue 6 years ago • 0 comments

If you do this:

var logger = bunyan.createLogger({
  name: "My Application",
  streams: [
    { stream: process.stdout },
    { stream: esStream, type: 'raw' }
  ],
  serializers: bunyan.stdSerializers
});

Then bunyan will send you raw JSON objects instead of sending you strings, so you won't have to call JSON.parse() on the log entry that Bunyan just JSON.stringified().

jwalton avatar Jun 21 '18 21:06 jwalton