mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor!: LOG_LEVEL => IMMICH_LOG_LEVEL (#9557)
refactor: LOG_LEVEL => IMMICH_LOG_LEVEL
This commit is contained in:
parent
101bc290f9
commit
4807fc40a6
6 changed files with 9 additions and 9 deletions
|
|
@ -62,7 +62,7 @@ export class SystemConfigService {
|
|||
@OnServerEvent(ServerAsyncEvent.CONFIG_VALIDATE)
|
||||
onValidateConfig({ newConfig, oldConfig }: ServerAsyncEventMap[ServerAsyncEvent.CONFIG_VALIDATE]) {
|
||||
if (!_.isEqual(instanceToPlain(newConfig.logging), oldConfig.logging) && this.getEnvLogLevel()) {
|
||||
throw new Error('Logging cannot be changed while the environment variable LOG_LEVEL is set.');
|
||||
throw new Error('Logging cannot be changed while the environment variable IMMICH_LOG_LEVEL is set.');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -135,10 +135,10 @@ export class SystemConfigService {
|
|||
const configLevel = logging.enabled ? logging.level : false;
|
||||
const level = envLevel ?? configLevel;
|
||||
this.logger.setLogLevel(level);
|
||||
this.logger.log(`LogLevel=${level} ${envLevel ? '(set via LOG_LEVEL)' : '(set via system config)'}`);
|
||||
this.logger.log(`LogLevel=${level} ${envLevel ? '(set via IMMICH_LOG_LEVEL)' : '(set via system config)'}`);
|
||||
}
|
||||
|
||||
private getEnvLogLevel() {
|
||||
return process.env.LOG_LEVEL as LogLevel;
|
||||
return process.env.IMMICH_LOG_LEVEL as LogLevel;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue