{"action":"created","issue":{"url":"https://api.github.com/repos/kenperkins/winston-papertrail/issues/34","labels_url":"https://api.github.com/repos/kenperkins/winston-papertrail/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/kenperkins/winston-papertrail/issues/34/comments","events_url":"https://api.github.com/repos/kenperkins/winston-papertrail/issues/34/events","html_url":"https://github.com/kenperkins/winston-papertrail/pull/34","id":59738043,"number":34,"title":"Call winston.Transport constructor to initialize parent fields","user":{"login":"jahqueel","id":10198670,"avatar_url":"https://avatars.githubusercontent.com/u/10198670?v=3","gravatar_id":"","url":"https://api.github.com/users/jahqueel","html_url":"https://github.com/jahqueel","followers_url":"https://api.github.com/users/jahqueel/followers","following_url":"https://api.github.com/users/jahqueel/following{/other_user}","gists_url":"https://api.github.com/users/jahqueel/gists{/gist_id}","starred_url":"https://api.github.com/users/jahqueel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jahqueel/subscriptions","organizations_url":"https://api.github.com/users/jahqueel/orgs","repos_url":"https://api.github.com/users/jahqueel/repos","events_url":"https://api.github.com/users/jahqueel/events{/privacy}","received_events_url":"https://api.github.com/users/jahqueel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-04T01:47:38Z","updated_at":"2015-12-02T19:57:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kenperkins/winston-papertrail/pulls/34","html_url":"https://github.com/kenperkins/winston-papertrail/pull/34","diff_url":"https://github.com/kenperkins/winston-papertrail/pull/34.diff","patch_url":"https://github.com/kenperkins/winston-papertrail/pull/34.patch"},"body":"I ran across an error when handleExceptions:true and colorize:true are both set, and the global exception handler is triggered. It's related to a field which has been added to the winston.Transport constructor, but is not set the Papertrail constructor. The other transports call the parent constructor to take care of it, and this little patch does the same.\r\n\r\nTest script:\r\n\r\n```javascript\r\nvar winston = require('winston');\r\nvar Papertrail = require('winston-papertrail').Papertrail;\r\nvar logger = new winston.Logger({\r\n  transports: [\r\n    new Papertrail({\r\n      host: process.env.PAPERTRAIL_HOST,\r\n      port: process.env.PAPERTRAIL_PORT,\r\n      colorize: true,\r\n      handleExceptions: true\r\n    })\r\n  ],\r\n  exitOnError: true\r\n});\r\nthrow new Error(\"Bye\");\r\n```\r\n\r\nException trace:\r\n\r\n    /home/ec2-user/bug/node_modules/winston/lib/winston/config.js:26\r\n      } else if (allColors[level].match(/\\s/)) {\r\n                                  ^\r\n    TypeError: Cannot call method 'match' of undefined\r\n        at Object.config.colorize (/home/ec2-user/bug/node_modules/winston/lib/winston/config.js:26:31)\r\n        at Papertrail.sendMessage (/home/ec2-user/bug/node_modules/winston-papertrail/lib/winston-papertrail.js:348:68)\r\n        at Papertrail.log (/home/ec2-user/bug/node_modules/winston-papertrail/lib/winston-papertrail.js:300:10)\r\n        at Transport.logException (/home/ec2-user/bug/node_modules/winston/lib/winston/transports/transport.js:124:8)\r\n        at logAndWait (/home/ec2-user/bug/node_modules/winston/lib/winston/logger.js:631:15)\r\n        at /home/ec2-user/bug/node_modules/winston/node_modules/async/lib/async.js:125:13\r\n        at Array.forEach (native)\r\n        at _each (/home/ec2-user/bug/node_modules/winston/node_modules/async/lib/async.js:46:24)\r\n        at Object.async.each (/home/ec2-user/bug/node_modules/winston/node_modules/async/lib/async.js:124:9)\r\n        at Logger._uncaughtException (/home/ec2-user/bug/node_modules/winston/lib/winston/logger.js:654:9)"},"comment":{"url":"https://api.github.com/repos/kenperkins/winston-papertrail/issues/comments/161414870","html_url":"https://github.com/kenperkins/winston-papertrail/pull/34#issuecomment-161414870","issue_url":"https://api.github.com/repos/kenperkins/winston-papertrail/issues/34","id":161414870,"user":{"login":"gabmontes","id":2621975,"avatar_url":"https://avatars.githubusercontent.com/u/2621975?v=3","gravatar_id":"","url":"https://api.github.com/users/gabmontes","html_url":"https://github.com/gabmontes","followers_url":"https://api.github.com/users/gabmontes/followers","following_url":"https://api.github.com/users/gabmontes/following{/other_user}","gists_url":"https://api.github.com/users/gabmontes/gists{/gist_id}","starred_url":"https://api.github.com/users/gabmontes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabmontes/subscriptions","organizations_url":"https://api.github.com/users/gabmontes/orgs","repos_url":"https://api.github.com/users/gabmontes/repos","events_url":"https://api.github.com/users/gabmontes/events{/privacy}","received_events_url":"https://api.github.com/users/gabmontes/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T19:57:03Z","updated_at":"2015-12-02T19:57:03Z","body":"Thanks @jahqueel! Merged it in my own fork until it is merged here!"}}