chore(backend): Duidelijkere MikroORM logging
Zorgt voor beter formaat en juiste labels
This commit is contained in:
parent
e6c03c1aca
commit
eca8d89712
5 changed files with 38 additions and 13 deletions
|
@ -1,12 +1,20 @@
|
|||
import { Options } from '@mikro-orm/core';
|
||||
import { LoggerOptions, Options } from '@mikro-orm/core';
|
||||
import { PostgreSqlDriver } from '@mikro-orm/postgresql';
|
||||
import { MikroOrmLogger } from './logging/mikroOrmLogger.js';
|
||||
import { LOG_LEVEL } from './config.js';
|
||||
|
||||
const config: Options = {
|
||||
driver: PostgreSqlDriver,
|
||||
dbName: 'dwengo',
|
||||
password: 'postgres',
|
||||
entities: ['dist/**/*.entity.js'],
|
||||
entitiesTs: ['src/**/*.entity.ts'],
|
||||
debug: true,
|
||||
|
||||
// Logging
|
||||
debug: LOG_LEVEL === 'debug',
|
||||
loggerFactory: (options: LoggerOptions) => {
|
||||
return new MikroOrmLogger(options);
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue