elastic / apm-agent-nodejs

https://www.elastic.co/guide/en/apm/agent/nodejs/current/index.html
BSD 2-Clause "Simplified" License
582 stars 224 forks source link

Support for more loggers in apm.start #3400

Open reediculous456 opened 1 year ago

reediculous456 commented 1 year ago

Is your feature request related to a problem? Please describe. All of my applications use Winston for logging and I would like to be able to combine the output from elastic-apm-node into my normal log stream output so that I do not miss any errors reported there.

Describe the solution you'd like Implement logging in a more abstract way so that users can use Pino, Winston, Log4js or other popular logging libraries

Describe alternatives you've considered I tried to map the winston logger interface to emulate Pino with no success

trentm commented 1 year ago

Hi @reediculous456, thanks for the issue. To be honest my preference would be to reduce the complexity of our logger setup. The current support in elastic-apm-node for non-Pino external loggers is a little bit of a hack in that it has the limitation of only logging the string "message" argument.

Are you able to show some of the code you had attempting to map the winston logger interface? I wonder if we could work together to get that to work. If so, then we could add documentation and an example showing how others users could do that.