mirror of
https://github.com/immich-app/immich.git
synced 2026-03-04 09:57:33 +03:00
feat(server): log http exceptions (#9996)
This commit is contained in:
@@ -30,17 +30,20 @@ export class LoggerRepository extends ConsoleLogger implements ILoggerRepository
|
||||
}
|
||||
|
||||
protected formatContext(context: string): string {
|
||||
let formattedContext = super.formatContext(context);
|
||||
let prefix = LoggerRepository.appName || '';
|
||||
if (context) {
|
||||
prefix += (prefix ? ':' : '') + context;
|
||||
}
|
||||
|
||||
const correlationId = this.cls?.getId();
|
||||
if (correlationId && this.isLevelEnabled(LogLevel.VERBOSE)) {
|
||||
formattedContext += `[${correlationId}] `;
|
||||
if (correlationId) {
|
||||
prefix += `~${correlationId}`;
|
||||
}
|
||||
|
||||
if (LoggerRepository.appName) {
|
||||
formattedContext = LogColor.blue(`[${LoggerRepository.appName}] `) + formattedContext;
|
||||
if (!prefix) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return formattedContext;
|
||||
return LogColor.yellow(`[${prefix}]`) + ' ';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user