golevelup / nestjs

A collection of badass modules and utilities to help you level up your NestJS applications 🚀
MIT License
2.26k stars 259 forks source link

Logging Errors #699

Closed irarayjenkins closed 6 days ago

irarayjenkins commented 7 months ago

https://github.com/golevelup/nestjs/blob/9ea5b3e3e7dceb1dcea9aca233ed306a15d3bb81/packages/rabbitmq/src/amqp/connection.ts#L228

A client application can use a custom logger, and properly pass that into this library and then correctly observe the relevant logs. Since this library uses ampq-connection-manager to support connection resiliency, auto-reconnect, and message queueing... are these logs produced on disconnect actually errors?

I wonder if there is a way for a client application to configure this behavior to either avoid these logs completely and implement their own .on('disconnect', ... ) or to consider changing these to warnings or info/log?

One option of course, would be a custom logger just for this library that either consumes the logs or de-escalates error to a warn?

underfisk commented 1 week ago

@irarayjenkins There may be multiple approaches to address this, one being you override Nestjs logger and proxy error calls but I feel that it could end up being hacky. Alternatively, we could support a new option that enables you to control the LogLevel.

If anyone's able to help with this enhancement I would appreciate :pray:

underfisk commented 6 days ago

You can override the logger by providing logger