Winston allows error to be passed directly to a log message https://github.com/winstonjs/logform#errors, like winston.error(new Error()), while ecs-winston-format requires errors to be added to the ecs-specific err field, like winston.errror({ err : new Error() })
This has two side effects. The minor one is that one must refactor its own code to match the ecs guidelines. The more annoying side effect is that this will not work with Winston's special Exception https://github.com/winstonjs/winston#exceptions and Rejection https://github.com/winstonjs/winston#handling-uncaught-promise-rejections-with-winston handlers
These handlers will log errors via Winston's default error handling and cannot be refactored to use the special ecs handling. As such, those errors don't show up correctly in Elasticsearch, making them harder to detect.
Please make ecs-winston-format compatible with default winston error handling.
@sveneh Thanks very much for this issue. Apologies for never having responded to it earlier. I hope to have a release out in the next week with the above fix.
Winston allows error to be passed directly to a log message https://github.com/winstonjs/logform#errors, like
winston.error(new Error())
, while ecs-winston-format requires errors to be added to the ecs-specificerr
field, likewinston.errror({ err : new Error() })
This has two side effects. The minor one is that one must refactor its own code to match the ecs guidelines. The more annoying side effect is that this will not work with Winston's special Exception https://github.com/winstonjs/winston#exceptions and Rejection https://github.com/winstonjs/winston#handling-uncaught-promise-rejections-with-winston handlers These handlers will log errors via Winston's default error handling and cannot be refactored to use the special ecs handling. As such, those errors don't show up correctly in Elasticsearch, making them harder to detect.
Please make ecs-winston-format compatible with default winston error handling.