diff --git a/backend/src/database.ts b/backend/src/database.ts index 9d21ac28e..4eba8cb6f 100644 --- a/backend/src/database.ts +++ b/backend/src/database.ts @@ -55,7 +55,7 @@ import { execSync } from 'child_process'; }).then(result => { resolve(result); }).catch(error => { - logger.debug(`database query "${query?.slice(0, 100)}" failed!`); + logger.debug(`database query "${query?.sql?.slice(0, 160) || (typeof(query) === 'string' || query instanceof String ? query?.slice(0, 160) : 'unknown query')}" failed!`); reject(error); }).finally(() => { clearTimeout(timer); @@ -66,7 +66,7 @@ import { execSync } from 'child_process'; const pool = await this.getPool(); return pool.query(query, params); } catch (e) { - logger.debug(`database query "${query?.slice(0, 100)}" failed!`); + logger.debug(`database query "${query?.sql?.slice(0, 160) || (typeof(query) === 'string' || query instanceof String ? query?.slice(0, 160) : 'unknown query')}" failed!`); throw e; } }