{"action":"created","issue":{"url":"https://api.github.com/repos/pinojs/pino-pretty/issues/39","repository_url":"https://api.github.com/repos/pinojs/pino-pretty","labels_url":"https://api.github.com/repos/pinojs/pino-pretty/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/pinojs/pino-pretty/issues/39/comments","events_url":"https://api.github.com/repos/pinojs/pino-pretty/issues/39/events","html_url":"https://github.com/pinojs/pino-pretty/issues/39","id":372277154,"node_id":"MDU6SXNzdWUzNzIyNzcxNTQ=","number":39,"title":"logger properties dropped when error object provided","user":{"login":"rayalan","id":2250337,"node_id":"MDQ6VXNlcjIyNTAzMzc=","avatar_url":"https://avatars3.githubusercontent.com/u/2250337?v=4","gravatar_id":"","url":"https://api.github.com/users/rayalan","html_url":"https://github.com/rayalan","followers_url":"https://api.github.com/users/rayalan/followers","following_url":"https://api.github.com/users/rayalan/following{/other_user}","gists_url":"https://api.github.com/users/rayalan/gists{/gist_id}","starred_url":"https://api.github.com/users/rayalan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayalan/subscriptions","organizations_url":"https://api.github.com/users/rayalan/orgs","repos_url":"https://api.github.com/users/rayalan/repos","events_url":"https://api.github.com/users/rayalan/events{/privacy}","received_events_url":"https://api.github.com/users/rayalan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-21T04:04:38Z","updated_at":"2018-10-22T11:59:45Z","closed_at":null,"author_association":"NONE","body":"Simple reproduction case (pino 5.8, pino-pretty 2.2.2): \r\n\r\n```\r\nconst pino = require('pino');\r\n\r\nconst pinoLogger = pino();\r\nconst log = pinoLogger.child({ project: 'my-project' });\r\n\r\nlog.error('This case works as expected');\r\n\r\ntry {\r\n    throw new Error('A thrown error');\r\n} catch (error) {\r\n    log.error(error, 'This case does not work');\r\n}\r\n```\r\n\r\nThen running `node example.js | pino-pretty` gives this (note the lack of a `my-project` field in the second log message): \r\n\r\n```\r\n[1540094314133] ERROR (87649 on redacted): This case works as expected\r\n    project: \"my-project\"\r\n[1540094314134] ERROR (87649 on redacted): This case does not work\r\n    Error: A thrown error\r\n        at Object.<anonymous> (redacted/example.js:9:11)\r\n        at Module._compile (module.js:643:30)\r\n        at Object.Module._extensions..js (module.js:654:10)\r\n        at Module.load (module.js:556:32)\r\n        at tryModuleLoad (module.js:499:12)\r\n        at Function.Module._load (module.js:491:3)\r\n        at Function.Module.runMain (module.js:684:10)\r\n        at startup (bootstrap_node.js:187:16)\r\n        at bootstrap_node.js:608:3\r\n```\r\nRunning just `node example.js` gives the underlying output that I expect with a `my-project` field in both json messages: \r\n\r\n```\r\n{\"level\":50,\"time\":1540094310116,\"msg\":\"This case works as expected\",\"pid\":87638,\"hostname\":\"redacted\",\"project\":\"my-project\",\"v\":1}\r\n{\"level\":50,\"time\":1540094310117,\"msg\":\"This case does not work\",\"pid\":87638,\"hostname\":\"redacted\",\"project\":\"my-project\",\"type\":\"Error\",\"stack\":\"Error: A thrown error\\n    at Object.<anonymous> (redacted/example.js:9:11)\\n    at Module._compile (module.js:643:30)\\n    at Object.Module._extensions..js (module.js:654:10)\\n    at Module.load (module.js:556:32)\\n    at tryModuleLoad (module.js:499:12)\\n    at Function.Module._load (module.js:491:3)\\n    at Function.Module.runMain (module.js:684:10)\\n    at startup (bootstrap_node.js:187:16)\\n    at bootstrap_node.js:608:3\",\"v\":1}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pinojs/pino-pretty/issues/comments/431814071","html_url":"https://github.com/pinojs/pino-pretty/issues/39#issuecomment-431814071","issue_url":"https://api.github.com/repos/pinojs/pino-pretty/issues/39","id":431814071,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTgxNDA3MQ==","user":{"login":"mcollina","id":52195,"node_id":"MDQ6VXNlcjUyMTk1","avatar_url":"https://avatars0.githubusercontent.com/u/52195?v=4","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T11:59:45Z","updated_at":"2018-10-22T11:59:45Z","author_association":"MEMBER","body":"From you said, it seems that the implementation of errorProps was not complete. Did I understand it wrong?"}}
{"actor":{"display_login":"mcollina"}}