{"_id":"restify-bunyan-logger","_rev":"1927330","name":"restify-bunyan-logger","description":"Bunyan Logger for Restify =========================","dist-tags":{"latest":"2.0.7"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"time":{"modified":"2021-12-09T13:51:57.000Z","created":"2014-11-20T14:25:08.875Z","2.0.7":"2015-03-17T10:09:54.962Z","2.0.6":"2014-11-27T16:55:31.778Z","2.0.5":"2014-11-26T17:07:55.049Z","2.0.4":"2014-11-25T18:02:48.977Z","2.0.3":"2014-11-25T17:54:18.413Z","2.0.2":"2014-11-25T15:12:36.331Z","2.0.1":"2014-11-25T14:20:47.940Z","2.0.0":"2014-11-25T13:56:27.419Z","1.0.1":"2014-11-20T15:00:39.940Z","1.0.0":"2014-11-20T14:25:08.875Z"},"users":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"versions":{"2.0.7":{"name":"restify-bunyan-logger","version":"2.0.7","main":"lib/index.js","bin":{"restify-bunyan-logger":"./bin/restify-bunyan-logger"},"scripts":{"lint":"jshint lib/"},"dependencies":{"underscore":"^1.7.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"1c726114898cd86a78a6a1bf6c587dffcbeb4462","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@2.0.7","_shasum":"be50010bfee2c7e49d1406914d2fe9a92a9351c5","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"be50010bfee2c7e49d1406914d2fe9a92a9351c5","size":17677,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-2.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-2.0.7.tgz"},"directories":{},"publish_time":1426586994962,"_cnpm_publish_time":1426586994962,"_hasShrinkwrap":false},"2.0.6":{"name":"restify-bunyan-logger","version":"2.0.6","main":"lib/index.js","bin":{"restify-bunyan-logger":"./bin/restify-bunyan-logger"},"scripts":{"lint":"jshint lib/"},"dependencies":{"underscore":"^1.7.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"b3435b014e167ef737d082d9b642b0e9519ada86","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@2.0.6","_shasum":"b4833b980ceebad1b5ce4ee5d44de164326bcdd6","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"b4833b980ceebad1b5ce4ee5d44de164326bcdd6","size":17603,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-2.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-2.0.6.tgz"},"directories":{},"publish_time":1417107331778,"_cnpm_publish_time":1417107331778,"_hasShrinkwrap":false},"2.0.5":{"name":"restify-bunyan-logger","version":"2.0.5","main":"lib/index.js","bin":{"restify-bunyan-logger":"./bin/restify-bunyan-logger"},"scripts":{"lint":"jshint lib/"},"dependencies":{"underscore":"^1.7.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"2bffacf5a9157bbd8294e54d7254f77eddcf685a","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@2.0.5","_shasum":"08310753b65ac6875e07fb00919b4c9cd8c6ba70","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"08310753b65ac6875e07fb00919b4c9cd8c6ba70","size":17103,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-2.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-2.0.5.tgz"},"directories":{},"publish_time":1417021675049,"_cnpm_publish_time":1417021675049,"_hasShrinkwrap":false},"2.0.4":{"name":"restify-bunyan-logger","version":"2.0.4","main":"lib/index.js","bin":{"restify-bunyan-logger":"./bin/restify-bunyan-logger"},"scripts":{"lint":"jshint lib/"},"dependencies":{"underscore":"^1.7.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"82f5784eed5e9e5926694a67bf11271710af35b1","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@2.0.4","_shasum":"3876d53dd20aae54a794adcd64b2f75e2953084e","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"3876d53dd20aae54a794adcd64b2f75e2953084e","size":17087,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-2.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-2.0.4.tgz"},"directories":{},"publish_time":1416938568977,"_cnpm_publish_time":1416938568977,"_hasShrinkwrap":false},"2.0.3":{"name":"restify-bunyan-logger","version":"2.0.3","main":"lib/index.js","bin":{"restify-bunyan-logger":"./bin/restify-bunyan-logger"},"scripts":{"lint":"jshint lib/"},"dependencies":{"underscore":"^1.7.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"8cb665b53bfd99a82fda2d22dedf6c7b4bf22346","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@2.0.3","_shasum":"7a68b79a1543ce3a4ea4d5f42cf6186df8a6fb3d","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"7a68b79a1543ce3a4ea4d5f42cf6186df8a6fb3d","size":17104,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-2.0.3.tgz"},"directories":{},"publish_time":1416938058413,"_cnpm_publish_time":1416938058413,"_hasShrinkwrap":false},"2.0.2":{"name":"restify-bunyan-logger","version":"2.0.2","main":"lib/index.js","bin":{"restify-bunyan-logger":"./bin/restify-bunyan-logger"},"scripts":{"lint":"jshint lib/"},"dependencies":{"underscore":"^1.7.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"13fcd71c24aa65e5c4aa39150481041089517c03","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@2.0.2","_shasum":"02ea0f1a03c67495607ec26c84cd53bc46d65aad","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"02ea0f1a03c67495607ec26c84cd53bc46d65aad","size":16861,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-2.0.2.tgz"},"directories":{},"publish_time":1416928356331,"_cnpm_publish_time":1416928356331,"_hasShrinkwrap":false},"2.0.1":{"name":"restify-bunyan-logger","version":"2.0.1","main":"lib/index.js","bin":{"restify-bunyan-logger":"./bin/restify-bunyan-logger"},"scripts":{"lint":"jshint lib/"},"dependencies":{"underscore":"^1.7.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"d31dbd5eba6a69be55f5e00f8acd8becc488808e","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@2.0.1","_shasum":"ade3fda45b015e8b4bce36b552abfdf2b73928c5","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"ade3fda45b015e8b4bce36b552abfdf2b73928c5","size":16817,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-2.0.1.tgz"},"directories":{},"publish_time":1416925247940,"_cnpm_publish_time":1416925247940,"_hasShrinkwrap":false},"2.0.0":{"name":"restify-bunyan-logger","version":"2.0.0","main":"lib/index.js","bin":{"restify-bunyan-logger":"./bin/restify-bunyan-logger"},"scripts":{"lint":"jshint lib/"},"dependencies":{"underscore":"^1.7.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"ff9f20a4b3d7bc9ef08132362dc6fe81a1f35dd1","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@2.0.0","_shasum":"dc02b1438b702db2e25e4dee1fa9c2a7188263e8","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"dc02b1438b702db2e25e4dee1fa9c2a7188263e8","size":16764,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-2.0.0.tgz"},"directories":{},"publish_time":1416923787419,"_cnpm_publish_time":1416923787419,"_hasShrinkwrap":false},"1.0.1":{"name":"restify-bunyan-logger","version":"1.0.1","main":"lib/index.js","scripts":{"lint":"jshint lib/"},"dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"a30b032226a22cfb3df4c6aacdd522d4066e987d","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@1.0.1","_shasum":"69c1f8beaa5402b856070802b51ea872ab3dc614","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"69c1f8beaa5402b856070802b51ea872ab3dc614","size":2403,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-1.0.1.tgz"},"directories":{},"publish_time":1416495639940,"_cnpm_publish_time":1416495639940,"_hasShrinkwrap":false},"1.0.0":{"name":"restify-bunyan-logger","version":"1.0.0","main":"lib/index.js","scripts":{"lint":"jshint lib/"},"dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"licence":"MIT","engines":{"node":">=0.10"},"gitHead":"3d5d0aa551c6e5fc0442bcd6d16a0fb8ce90b280","description":"Bunyan Logger for Restify =========================","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","_id":"restify-bunyan-logger@1.0.0","_shasum":"76d030967eeef8f3b6a1190e64fe65c07d1e5336","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"},"maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"dist":{"shasum":"76d030967eeef8f3b6a1190e64fe65c07d1e5336","size":2359,"noattachment":false,"key":"/restify-bunyan-logger/-/restify-bunyan-logger-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/restify-bunyan-logger/download/restify-bunyan-logger-1.0.0.tgz"},"directories":{},"publish_time":1416493508875,"_cnpm_publish_time":1416493508875,"_hasShrinkwrap":false}},"readme":"Bunyan Logger for Restify\n=========================\n\nAdd bunyan logging to your restify app.\n\n## Installation\n```\nnpm install restify-bunyan-logger\n```\n\nUse `--save` to add the package to your current package.json.\n\n## Usage\nBasic usage is one line (if you're already using bunyan):\n\n```js\nvar restifyBunyanLogger = require('restify-bunyan-logger');\nserver.on('after', restifyBunyanLogger());\n```\n\nIf you're not using bunyan, you'll need to update your server creation too:\n\n```js\nvar Logger = require('bunyan');\nvar server = restify.createServer({\n  log: new Logger.createLogger({\n    name: \"your app name\",\n  })\n});\n```\n\n\n### Parameters\n`restifyBunyanLogger` takes an option parameter. Valid keys are:\n\n* `skip`: function to skip some logs. Take as parameters req and res, must return true to skip the logging of this request.\n* `custom`: function to add custom values to the bunyan log. Take as parameters req, res, route, err, log (a pre defined log object). Must return a Javascript object.\n* `logger`: a custom bunyan logger. Will default to req.log if unspecified\n\n```js\nserver.on('after', restifyBunyanLogger({\n  skip: function(req, res) {\n    return req.method === \"OPTIONS\";\n  },\n  custom: function(req, res, route, err, log) {\n    // This will not work when using gzip.\n    log.res.length = res.get('Content-Length');\n\n    // Don't forget to return!\n    return log;\n  },\n  logger: bunyanLogger\n}));\n```\n\n## CLI usage\nYou can pipe your json logs into `bin/restify-bunyan-logger` (or `restify-bunyan-logger` when installed with `npm -g`) to get a nicely formatted one-line view.\n\nThis is a dirty hack around the standard bunyan logger, until https://github.com/trentm/node-bunyan/pull/191 is merged.\n\n## More...\nThis package fits nicely with the default restify bunyan implementation, and will use any custom logger you want.\nYou may want to add `server.use(restify.requestLogger());` to get a unique request identifier on each log.\n\n## I'm using express\nI'm quite sad for you. If you want, you can use this simple wrapper to get lbunyan logging on express:\n\n```js\n'use strict';\nvar onFinished = require('on-finished');\nvar BunyanLogger = require('restify-bunyan-logger');\nvar Logger = require('bunyan');\n\n\nvar bunyanLogger = new BunyanLogger({\n  custom: function(req, res, route, err, log) {\n    log.req.route = req.route ? req.route.path : null;\n    return log;\n  },\n  logger: new Logger.createLogger(),\n});\n\n\n\nmodule.exports = function(req, res, next) {\n  req._startAt = new Date();\n  onFinished(res, function(err) {\n    req.time = function() {\n      return req._startAt;\n    };\n    bunyanLogger(req, res, null, err);\n  });\n\n  next();\n};\n```\n","_attachments":{},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"}}