From f242a37c3a0914c37a32d78dd3ca3d9b704fcf79 Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Mon, 21 Aug 2023 15:37:04 +0200 Subject: [PATCH] Docker: Add monolog configuration when running as a container This will let the logs go to stdout when running as a container, which is the Docker way to send logs --- config/packages/prod/monolog.yaml.docker | 15 +++++++++++++++ docker/Dockerfile.prod | 1 + 2 files changed, 16 insertions(+) create mode 100644 config/packages/prod/monolog.yaml.docker diff --git a/config/packages/prod/monolog.yaml.docker b/config/packages/prod/monolog.yaml.docker new file mode 100644 index 00000000..5941f1b7 --- /dev/null +++ b/config/packages/prod/monolog.yaml.docker @@ -0,0 +1,15 @@ +monolog: + handlers: + prod-signaler: + type: fingers_crossed + action_level: ERROR + passthru_level: NOTICE # this means that all message of level NOTICE or higher are always logged + handler: main_syslog + bubble: false # if we handle it, nothing else should + main_syslog: + type: stream + path: "php://stderr" + formatter: surfnet_stepup.monolog.json_formatter + console: + type: console + process_psr_3_messages: false diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod index 885c364f..24368782 100644 --- a/docker/Dockerfile.prod +++ b/docker/Dockerfile.prod @@ -6,6 +6,7 @@ RUN tar -xvjf /tmp/*.tar.bz2 -C /var/www/html/ && \ # Add the application configuration files RUN cp .env.dist .env RUN cp config/packages/parameters.yml.dist config/packages/parameters.yml +COPY config/packages/prod/monolog.yaml.docker config/packages/prod/monolog.yaml # Add the config files for Apache2 RUN rm -rf /etc/apache2/sites-enabled/*