Browse Source

feat(core): Verbose query error logging (#433)

When the LogLevel is set to `Verbose`, the full error message will be logged on any TypeORM errors.
Thomas Blommaert 5 năm trước cách đây
mục cha
commit
8cf7483080

+ 1 - 0
packages/core/src/config/logger/typeorm-logger.ts

@@ -50,6 +50,7 @@ export class TypeOrmLogger implements TypeOrmLoggerInterface {
         if (this.shouldDisplay('error')) {
         if (this.shouldDisplay('error')) {
             const sql = this.formatQueryWithParams(query, parameters);
             const sql = this.formatQueryWithParams(query, parameters);
             Logger.error(`Query error: ${sql}`, context);
             Logger.error(`Query error: ${sql}`, context);
+            Logger.verbose(error, context);
         }
         }
     }
     }