mirror of
https://github.com/immich-app/immich.git
synced 2026-03-06 10:07:48 +03:00
feat(server): run microservices in worker thread (#9426)
feat: start microservices in worker thread and add internal microservices for the server
This commit is contained in:
@@ -3,6 +3,7 @@ import { isLogLevelEnabled } from '@nestjs/common/services/utils/is-log-level-en
|
||||
import { ClsService } from 'nestjs-cls';
|
||||
import { LogLevel } from 'src/entities/system-config.entity';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { LogColor } from 'src/utils/logger-colors';
|
||||
|
||||
const LOG_LEVELS = [LogLevel.VERBOSE, LogLevel.DEBUG, LogLevel.LOG, LogLevel.WARN, LogLevel.ERROR, LogLevel.FATAL];
|
||||
|
||||
@@ -14,6 +15,12 @@ export class LoggerRepository extends ConsoleLogger implements ILoggerRepository
|
||||
super(LoggerRepository.name);
|
||||
}
|
||||
|
||||
private static appName?: string = undefined;
|
||||
|
||||
setAppName(name: string): void {
|
||||
LoggerRepository.appName = name;
|
||||
}
|
||||
|
||||
isLevelEnabled(level: LogLevel) {
|
||||
return isLogLevelEnabled(level, LoggerRepository.logLevels);
|
||||
}
|
||||
@@ -30,6 +37,10 @@ export class LoggerRepository extends ConsoleLogger implements ILoggerRepository
|
||||
formattedContext += `[${correlationId}] `;
|
||||
}
|
||||
|
||||
if (LoggerRepository.appName) {
|
||||
formattedContext = LogColor.blue(`[${LoggerRepository.appName}] `) + formattedContext;
|
||||
}
|
||||
|
||||
return formattedContext;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user