TypeORM does not use custom logger when migration fails
udaya2899 opened this issue · comments
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
When migrationsRun
is set to true
and some error occurs while running migrations, TypeOrmModule doesn't use the passed custom logger, instead uses the default logger to log errors that occurred while running migrations.
Minimum reproduction code
https://gist.github.com/udaya2899/5bafe152d53800aff7ce980df8c871f3
Steps to reproduce
1. set `migrationsRun` to true
2. Pass a custom logger object in `logger`
2. Try to run a migration that will fail
3. Initialise the project, check if the custom logger was used for logging failed migrations or not
Expected behavior
The passed logger object should be used even for logging failed migrations
Package version
7.1.5
NestJS version
7.6.13
Node.js version
14.14.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
Does this properly use the custom logger when using a TypeORM configuration outside of Nest's module?
Unfortunately, I use TypeORM only with the Nest module.
This issue doesn't seem to be related to @nestjs/typeorm
package.
Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.