{"action":"created","issue":{"url":"https://api.github.com/repos/andrewrk/naught/issues/71","labels_url":"https://api.github.com/repos/andrewrk/naught/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/andrewrk/naught/issues/71/comments","events_url":"https://api.github.com/repos/andrewrk/naught/issues/71/events","html_url":"https://github.com/andrewrk/naught/issues/71","id":58171880,"number":71,"title":"is there an example of using domains with naught","user":{"login":"thedug","id":158122,"avatar_url":"https://avatars.githubusercontent.com/u/158122?v=3","gravatar_id":"","url":"https://api.github.com/users/thedug","html_url":"https://github.com/thedug","followers_url":"https://api.github.com/users/thedug/followers","following_url":"https://api.github.com/users/thedug/following{/other_user}","gists_url":"https://api.github.com/users/thedug/gists{/gist_id}","starred_url":"https://api.github.com/users/thedug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thedug/subscriptions","organizations_url":"https://api.github.com/users/thedug/orgs","repos_url":"https://api.github.com/users/thedug/repos","events_url":"https://api.github.com/users/thedug/events{/privacy}","received_events_url":"https://api.github.com/users/thedug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-19T06:12:55Z","updated_at":"2015-02-21T06:43:12Z","closed_at":null,"body":"Is there an example of using domains to capture an uncaught exception and gracefully shutdown?"},"comment":{"url":"https://api.github.com/repos/andrewrk/naught/issues/comments/75359128","html_url":"https://github.com/andrewrk/naught/issues/71#issuecomment-75359128","issue_url":"https://api.github.com/repos/andrewrk/naught/issues/71","id":75359128,"user":{"login":"mathrawka","id":194223,"avatar_url":"https://avatars.githubusercontent.com/u/194223?v=3","gravatar_id":"","url":"https://api.github.com/users/mathrawka","html_url":"https://github.com/mathrawka","followers_url":"https://api.github.com/users/mathrawka/followers","following_url":"https://api.github.com/users/mathrawka/following{/other_user}","gists_url":"https://api.github.com/users/mathrawka/gists{/gist_id}","starred_url":"https://api.github.com/users/mathrawka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathrawka/subscriptions","organizations_url":"https://api.github.com/users/mathrawka/orgs","repos_url":"https://api.github.com/users/mathrawka/repos","events_url":"https://api.github.com/users/mathrawka/events{/privacy}","received_events_url":"https://api.github.com/users/mathrawka/received_events","type":"User","site_admin":false},"created_at":"2015-02-21T06:43:12Z","updated_at":"2015-02-21T06:43:12Z","body":"I have used loggly and papertrail in the past. Here is a snippet of more\r\nproduction code:\r\n\r\n```js\r\n    logger = new (winston.Logger)({\r\n      transports: [\r\n        new (winston.transports.Mail)({\r\n            to       : 'xxx'\r\n          , from     : 'xxxx'\r\n          , host     : 'smtp.mandrillapp.com'\r\n          , port     : 587\r\n          , tls      : true\r\n          , username : process.env.MANDRILL_USERNAME\r\n          , password : process.env.MANDRILL_APIKEY\r\n          , level    : 'error'\r\n          }),\r\n        new (winston.transports.Console)({colorize: true, timestamp: true}),\r\n        new (winston.transports.Papertrail)({\r\n            host: 'logs.papertrailapp.com'\r\n          , port: process.env.PAPERTRAIL_PORT\r\n          , inlineMeta: true\r\n        })\r\n      ]\r\n    })\r\n\r\n    app.use(reqLogger.create(logger))\r\n```\r\n\r\nThe reqLogger is from a different package of mine, express-request-logger.\r\nI expose the winston logger object to my routes, and use it like this:\r\n\r\n```js\r\n      logger.warn('Invalid receipt', {body: body, email: req.user.email})\r\n```\r\n"}}