use log levels in custom typeorm logger

This commit is contained in:
Hongbo Wu
2023-09-26 12:48:47 +08:00
parent efdbc4f345
commit cbf58614c4
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ export const appDataSource = new DataSource({
entities: [__dirname + '/entity/**/*{.js,.ts}'],
subscribers: [__dirname + '/events/**/*{.js,.ts}'],
namingStrategy: new SnakeNamingStrategy(),
logger: new CustomTypeOrmLogger(),
logger: new CustomTypeOrmLogger(['query', 'info']),
connectTimeoutMS: 40000, // 40 seconds
maxQueryExecutionTime: 10000, // 10 seconds
})

View File

@ -29,7 +29,7 @@ export class CustomTypeOrmLogger
private logger: Logger
constructor(options?: TypeOrmLoggerOptions) {
super(false)
super(options)
this.logger = buildLogger('typeorm')
}