{"_id":"restify-bunyan-logger","_rev":"22-19405e4c59ea31ec151de4f56000f178","name":"restify-bunyan-logger","description":"Bunyan Logger for Restify =========================","dist-tags":{"latest":"2.0.7"},"versions":{"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-1.0.0.tgz","integrity":"sha512-5cXat1IBzukashrKrp0sVOkrn7WgCHDGngjz8XRSP/PfSNKRxZaq6O8puZQ0Wxb+LpHrdlXHW94b0w3xKgaqIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuFvHi9qfxMIZa5ACzZZ4xoQP1JHN7g1GjjWmiUqa/UAIgO3+gFt2vlIObImHRRJ93YgX+Vx+eyndIo8pgKlqb3yk="}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-1.0.1.tgz","integrity":"sha512-bFCSPoeG7AtcPmb5TWRIbRiAoCCqsEegLWjWl87hxRoHYDwmp1o5IcDkihwo6ehVoWT2d1AQIrRnOzhJJOCoLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzAkZorIEOYQa2OwOs0vFqCiXnzME5RrrXU66vt938HAiEAvu3ZaLJyToNUibv79X7c+3Z9M3RyD9MmE8Ljuy+qZvw="}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-2.0.0.tgz","integrity":"sha512-w2A4H086Wd/tIm7DeYqBKsxRH4olttdcly+esdBvB/FOJfCzc2k7InuGgs7lF4iME8LjDXukXBacpQpKe9YPzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8BCzGVthJqYgTpKUGW7Y4au4Eo4MTytt0dH7PLSUcxAIhAMxH09IlWVpl5eGu9W5jxrlTE0TUc+jVvPhZy7KvyD4Z"}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-2.0.1.tgz","integrity":"sha512-3lt2qrZUqUM0b7SHmwhlROdS444aalAg8u2pZkHYI4jj6/VPe+2mTlVSs+ECr04W0hgXHeC0es6RgtiQzib3HA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/nYC2qX+0CiCeUZM8KdbdXmVQPlRXZhvKnG3vKMPBfwIgYZWZf0qTV8t/TcYrg/SxAzdEPcpb8EHwl0Kr5BOG9kU="}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-2.0.2.tgz","integrity":"sha512-CJWSkojjmwrXKK4FfXaEXMoIJ9sbzfgP62hcz4g21TwMD8bYhf0ZiPwjQk+WEqR/O/uYRObsWyvvLUqnGd+fDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1VJfGyKfoEHwt1FD+eLE3V/lWZSg8/BIYJ7NIAz1k6QIgG2rubaihdHR/thpw/esS2tMd9mHZgryWB5D+n8ee1Q0="}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-2.0.3.tgz","integrity":"sha512-zamKh8vb2dgBN3wPvYClt8pcW3wIWdrYnLyCxzuA2DfRtaLD0vKYLr8YcHKdM55Eeuo7MZ99s83oq2tsoqorHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+BCru9uKkLe4ooX6gOQaulsdhmh4UQvgs/g86lIuWswIgE0CvIw+FyTAB/J4LcG8bhGfMQZk2zkpKHYvp026U0eQ="}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-2.0.4.tgz","integrity":"sha512-qQYNCkG9ueFSivLiE7Wu4GN+yT7eNxctjS8dliGs15EyjDWOqhkGO/jhFjnkc8M2YdR4excguHXOZIwgB5Y4Gw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1bOXClL2CzarTJe1n6KphAm1mK6e77x1/HQ/rNbg13QIgf4ny6hluXmv9q1bEbDhbz2QWRgpjx+apnE58aRDZ+Ns="}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-2.0.5.tgz","integrity":"sha512-fhvku1j1QbO0M1LPdGS93YHsc2NKVeRRVvzkGMpoZ8mwOPWCjxknu87By4vxQWYtSlZu44O5CiIB8YpY7rd1qg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDC3MldZcBzk9KQbHPHp1Zzktz/wNSDAXlhCt/3Xnx0wgIgGsUSVPH9QkSAh6h5RZx7U6PeXyNnEuca4TrkqjxxT5k="}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-2.0.6.tgz","integrity":"sha512-rDe2+wyiAiS3tqU2WLy5JkRu1bS12sArXqRBHloEBgmk4lW8gqNi6KgswMQYI+5DWKph8XXDxszmhaoCzUZ4uQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0tWD2yG083z3A1NHafOznkp72a7Km7Hj1YSflzOExuQIgfdNdTjA09t6i23AG9asWGPqPsdnZiUkdu0dle+Hd1rM="}]}},"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","tarball":"https://registry.npmjs.org/restify-bunyan-logger/-/restify-bunyan-logger-2.0.7.tgz","integrity":"sha512-79yXC9YjQw2AfSfhhbaP3nZdCXjf1enm9NrKTVgbTjtR+04v2wqtpi7hBpRk2PoGzFXyoeFsCId/VMi76WThQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDked2TsomgYK0vSZYJocIZ3Lp7HJPPXfEFO++FaOBITwIgCBmghmSs2jO4NtiLG2abhRttsr+eQ9p4IX1e9HN5WHg="}]}}},"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","maintainers":[{"name":"matthieu.bacconnier","email":"matthieu.bacconnier@papiel.fr"}],"time":{"modified":"2022-06-26T12:08:25.656Z","created":"2014-11-20T14:25:08.875Z","1.0.0":"2014-11-20T14:25:08.875Z","1.0.1":"2014-11-20T15:00:39.940Z","2.0.0":"2014-11-25T13:56:27.419Z","2.0.1":"2014-11-25T14:20:47.940Z","2.0.2":"2014-11-25T15:12:36.331Z","2.0.3":"2014-11-25T17:54:18.413Z","2.0.4":"2014-11-25T18:02:48.977Z","2.0.5":"2014-11-26T17:07:55.049Z","2.0.6":"2014-11-27T16:55:31.778Z","2.0.7":"2015-03-17T10:09:54.962Z"},"homepage":"https://github.com/AnyFetch/restify-bunyan-logger","repository":{"type":"git","url":"https://github.com/AnyFetch/restify-bunyan-logger"},"bugs":{"url":"https://github.com/AnyFetch/restify-bunyan-logger/issues"},"readmeFilename":"readme.md"}