feat(server): implement switchable logging formats (console/json) (#24791)

* feat(server): add LogFormat enum and configuration

* feat(server): add structured logging formatters

* feat(server): implement switchable logging formats (console/json)

* Revert "feat(server): add LogFormat enum and configuration"

This reverts commit 565e95ae68.

* feat(server): implement JSON logging using NestJS native support

* refactor: rename LOG_FORMAT to IMMICH_LOG_FORMAT for consistency

* docs: add IMMICH_LOG_FORMAT documentation

* chore: format environment-variables.md

* chore: format monitoring.md
This commit is contained in:
Daniel Ramos
2026-01-05 16:21:02 +01:00
committed by GitHub
parent 4147f1d912
commit edd3ab7cc9
7 changed files with 67 additions and 8 deletions
@@ -17,6 +17,7 @@ import {
ImmichHeader,
ImmichTelemetry,
ImmichWorker,
LogFormat,
LogLevel,
QueueName,
} from 'src/enum';
@@ -29,6 +30,7 @@ export interface EnvData {
environment: ImmichEnvironment;
configFile?: string;
logLevel?: LogLevel;
logFormat?: LogFormat;
buildMetadata: {
build?: string;
@@ -233,6 +235,7 @@ const getEnv = (): EnvData => {
environment,
configFile: dto.IMMICH_CONFIG_FILE,
logLevel: dto.IMMICH_LOG_LEVEL,
logFormat: dto.IMMICH_LOG_FORMAT || LogFormat.Console,
buildMetadata: {
build: dto.IMMICH_BUILD,