{"action":"opened","issue":{"url":"https://api.github.com/repos/winstonjs/winston-loggly/issues/37","labels_url":"https://api.github.com/repos/winstonjs/winston-loggly/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/winstonjs/winston-loggly/issues/37/comments","events_url":"https://api.github.com/repos/winstonjs/winston-loggly/issues/37/events","html_url":"https://github.com/winstonjs/winston-loggly/issues/37","id":120192222,"number":37,"title":"Error instances are recorded as an empty object","user":{"login":"tomhaigh","id":2573870,"avatar_url":"https://avatars.githubusercontent.com/u/2573870?v=3","gravatar_id":"","url":"https://api.github.com/users/tomhaigh","html_url":"https://github.com/tomhaigh","followers_url":"https://api.github.com/users/tomhaigh/followers","following_url":"https://api.github.com/users/tomhaigh/following{/other_user}","gists_url":"https://api.github.com/users/tomhaigh/gists{/gist_id}","starred_url":"https://api.github.com/users/tomhaigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomhaigh/subscriptions","organizations_url":"https://api.github.com/users/tomhaigh/orgs","repos_url":"https://api.github.com/users/tomhaigh/repos","events_url":"https://api.github.com/users/tomhaigh/events{/privacy}","received_events_url":"https://api.github.com/users/tomhaigh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-03T15:08:46Z","updated_at":"2015-12-03T15:08:46Z","closed_at":null,"body":"When logging a meta value which contains an error, none of the properties are written, and the log message is lost.\r\ne.g. `winston.error(\"error\", new Error(\"test\"))`\r\n\r\noutput in loggly:\r\n`{\"level\":\"error\"}`\r\n\r\n- The error properties (message and stack) are not written because node-loggly doesn't write them to the JSON string (they are non-enumerable).\r\n- The log message is lost because the meta parameter, if supplied, forms the base message object appended to and passed to loggly. For Errors this already contains the `message` property as a getter which (per the above) isn't written to JSON. \r\n\r\nThis doesn't seem related to https://github.com/winstonjs/winston/issues/280 which I initially thought was the cause - updating to the latest version of Winston does not solve it. \r\n\r\nI think a fix requires more than just fixing the JSON-encoding of Error objects - that would still result in conflict between the two `message` properties when logging Errors (the error message and the log message). It could be nicer if the `meta` parameter was written to the loggly message as a `meta` property within the JSON, but this would be a change to existing behaviour.\r\n"}}