Skip to content

Commit

Permalink
Docker: Add monolog configuration when running as a container
Browse files Browse the repository at this point in the history
This will let the logs go to stdout when running as a container, which
is the Docker way to send logs
  • Loading branch information
quartje committed Aug 21, 2023
1 parent e0a97b7 commit f242a37
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions config/packages/prod/monolog.yaml.docker
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions docker/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down

0 comments on commit f242a37

Please sign in to comment.