thlorenz / bunyan-format

Writable stream that formats bunyan records that are piped into it
MIT License
51 stars 22 forks source link

Add support for file+line cron `{src: {}}` in bunyan output #7

Closed johnhof closed 8 years ago

johnhof commented 8 years ago

using an src value in the bunyan config yields a src property in the log, but it is not displayed in the formatter when streaming to the command line.

bunyan log file stream

{
  "name": "micron",
  "hostname": "Hof",
  "pid": 10313,
  "service": "http",
  "level": 30,
  "msg": "\u001b[38;5;255mREST service listening on port: \u001b[39m1991\n",
  "time": "2016-03-11T17:55:04.227Z",
  "src": {
    "file": "/foo/server.js",
    "line": 70
  },
  "v": 0
}

bunyan console stream

screen shot 2016-03-11 at 9 57 35 am

Project specific links https://github.com/fleekjs/micron/blob/master/server.js#L40 https://github.com/fleekjs/micron/blob/master/server.js#L44 https://github.com/fleekjs/micron/blob/master/config/index.json#L10

As a side note, thanks for writing this, my logs are beautiful now :100:

johnhof commented 8 years ago

already exists in long format