RabbitMQ: Logs still not right Nest 8
See original GitHub issueVersions:
- @golevelup/nestjs-rabbitmq : 3.2.0
- @golevelup/nestjs-discovery: 3.0.0
- @golevelup/nestjs-common: 1.4.4
Something still isn’t quite right with the logs. When I do this:
const app = await NestFactory.create(AppModule, {
logger: false,
});
I still get logs from RabbitMQModule:
[Nest] 31 - 08/02/2022, 2:54:27 PM LOG [AmqpConnection] Trying to connect to RabbitMQ broker (default)
[Nest] 31 - 08/02/2022, 2:54:27 PM LOG [AmqpConnection] Successfully connected to RabbitMQ broker (default)
[Nest] 31 - 08/02/2022, 2:54:27 PM LOG [RabbitMQModule] Successfully connected to RabbitMQ
[Nest] 31 - 08/02/2022, 2:54:27 PM LOG [AmqpConnection] Successfully connected a RabbitMQ channel "AmqpConnection"
[Nest] 31 - 08/02/2022, 2:54:27 PM LOG [RabbitMQModule] Initializing RabbitMQ Handlers
[Nest] 31 - 08/02/2022, 2:54:27 PM LOG [RabbitMQModule] Registering rabbitmq handlers from AddressListenerService
[Nest] 31 - 08/02/2022, 2:54:27 PM LOG [RabbitMQModule] AddressListenerService.onInteractionRecorded {subscribe} -> pubsub::interaction.recorded::service-suspect:address-listener:on-interaction-recorded
and nothing further.
I am suspecting its to do with the new logger instances created here but I haven’t had the chance currently to put into real testing.
because the official recommended ways to replace the logger just dont work with the latest changes:
- https://github.com/iamolegga/nestjs-pino#example
- https://docs.nestjs.com/techniques/logger#dependency-injection
Do you think that it can just be changed to how all the other modules do it?
- https://github.com/nestjs/graphql/blob/master/packages/graphql/lib/graphql.module.ts#L54
- https://github.com/nestjs/bull/blob/3b94b9dc6f9dcde444dbed6c04f41f28d7b9e025/packages/bullmq/lib/bull.explorer.ts#L32
- https://github.com/nestjs/sequelize/blob/5b4c350db87a4fb7b519ada41b7eb604366ca0d9/lib/common/sequelize.utils.ts#L10
- https://github.com/nestjs/cqrs/blob/d6c176bed923fe38c18d2a05c35c72a3dca6e663/src/event-bus.ts#L36
- https://github.com/nestjs/azure-database/blob/e368290afd64ff0768e13ddfaad9813c16a7905d/lib/table-storage/azure-table.service.ts#L3
I don’t use all of those, but none of them require defining a custom logger in their arguments for it to work correctly with overriding your own logger.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to View & Aggregate RabbitMQ Logs: 101 Logging Guide
Read about RabbitMQ log file format, location, log levels, and more. Basic tips on how to enable RabbitMQ logging and analyze logs for ......
Read more >rabbitmqctl(8) — RabbitMQ
Instructs the RabbitMQ node to perform internal log rotation. Log rotation is performed according to the logging settings specified in the configuration file....
Read more >Clustering Guide - RabbitMQ
Clustering Guide. Overview. This guide covers fundamental topics related to RabbitMQ clustering: How RabbitMQ nodes are identified: node names ...
Read more >Logging - RabbitMQ
Log Rotation. RabbitMQ nodes always append to the log files, so a complete log history is preserved. Log file rotation is not performed...
Read more >Command Line Tools - RabbitMQ
UTF-8). If that's not the case, the tools may still function correctly but it ... CLI tools can be used to talk to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I guess one solution would be to have both nest 8 and 9 as peer dependencies. The only real breaking change in v9 were unit tests, so it should (theoretically) work with both.
I wouldn’t backport these features to later versions though and I don’t think versioning works like that in this project. But I’m not a maintainer and it works for me 😃
Issue is in 2.4.1 and up. Could we get version 2 to stay with Nest 8 and version 3 to go with Nest 9?