diff --git a/backend/src/typeorm/connection.ts b/backend/src/typeorm/connection.ts index 0bb1b76bf..2793ec14e 100644 --- a/backend/src/typeorm/connection.ts +++ b/backend/src/typeorm/connection.ts @@ -3,6 +3,7 @@ import { entities } from 'database' import { Connection as DbConnection, FileLogger, createConnection } from 'typeorm' +import path from 'node:path' import { CONFIG } from '@/config' export class Connection { @@ -38,7 +39,7 @@ export class Connection { synchronize: false, logging: true, logger: new FileLogger('all', { - logPath: CONFIG.TYPEORM_LOGGING_RELATIVE_PATH, + logPath: path.resolve(__dirname, CONFIG.TYPEORM_LOGGING_RELATIVE_PATH), }), extra: { charset: 'utf8mb4_unicode_ci', diff --git a/dht-node/src/typeorm/connection.ts b/dht-node/src/typeorm/connection.ts index ea349655d..6348f38da 100644 --- a/dht-node/src/typeorm/connection.ts +++ b/dht-node/src/typeorm/connection.ts @@ -1,10 +1,10 @@ +import path from 'node:path' +import { CONFIG } from '@/config' // TODO This is super weird - since the entities are defined in another project they have their own globals. // We cannot use our connection here, but must use the external typeorm installation import { entities } from 'database' import { Connection, FileLogger, createConnection } from 'typeorm' -import { CONFIG } from '@/config' - export const connection = async (): Promise => { try { return createConnection({ @@ -19,7 +19,7 @@ export const connection = async (): Promise => { synchronize: false, logging: true, logger: new FileLogger('all', { - logPath: CONFIG.TYPEORM_LOGGING_RELATIVE_PATH, + logPath: path.resolve(__dirname, CONFIG.TYPEORM_LOGGING_RELATIVE_PATH), }), extra: { charset: 'utf8mb4_unicode_ci', diff --git a/federation/src/typeorm/connection.ts b/federation/src/typeorm/connection.ts index f76628767..d5ff19179 100644 --- a/federation/src/typeorm/connection.ts +++ b/federation/src/typeorm/connection.ts @@ -1,3 +1,4 @@ +import path from 'node:path' import { CONFIG } from '@/config' // TODO This is super weird - since the entities are defined in another project they have their own globals. // We cannot use our connection here, but must use the external typeorm installation @@ -18,7 +19,7 @@ const connection = async (): Promise => { synchronize: false, logging: true, logger: new FileLogger('all', { - logPath: CONFIG.TYPEORM_LOGGING_RELATIVE_PATH, + logPath: path.resolve(__dirname, CONFIG.TYPEORM_LOGGING_RELATIVE_PATH), }), extra: { charset: 'utf8mb4_unicode_ci',