From d8081431d59cf3ae334cdcb6a1de15fdf15e3713 Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Mon, 21 Aug 2023 15:54:29 +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 | 13 +++++++++++++ docker/Dockerfile.prod | 2 ++ 2 files changed, 15 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..3928853e --- /dev/null +++ b/config/packages/prod/monolog.yaml.docker @@ -0,0 +1,13 @@ +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 + diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod index baf3ec6a..d0283ced 100644 --- a/docker/Dockerfile.prod +++ b/docker/Dockerfile.prod @@ -6,6 +6,8 @@ RUN tar -xvjf /tmp/*.tar.bz2 -C /var/www/html/ && \ # Add the application configuration files COPY config/legacy/parameters.yaml.dist config/legacy/parameters.yaml COPY config/legacy/samlstepupproviders_parameters.yaml.dist config/legacy/samlstepupproviders_parameters.yaml +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/*