Skip to content

Commit

Permalink
feat: Possibility to set up logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Maya Baya committed May 29, 2022
1 parent a8e4c42 commit c4994ac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ ENV AUTO_UPDATE_CRON="0 5 * * TUE" \
WP_SITE_URL=example.org \
WP_SITE_ADMIN_LOGIN=admin \
WP_SITE_ADMIN_PASSWORD=riotkit \
[email protected]
[email protected] \
ACCESS_LOG=/dev/stdout \
ERROR_LOG=/dev/stderr

# p2 (jinja2)
RUN wget https://github.com/wrouesnel/p2cli/releases/download/r13/p2-linux-x86_64 -O /usr/bin/p2 && chmod +x /usr/bin/p2
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,25 @@ waf:
#DEBUG: true
```

Access log and error log
------------------------

Point access and error logs to files, to stdout/stderr or disable logging by using environment variables.

```bash
ACCESS_LOG: /dev/stdout
ERROR_LOG: /dev/stderr
```

```bash
ACCESS_LOG: /mnt/logs/access.log
ERROR_LOG: /mnt/logs/error.log
```

```bash
ACCESS_LOG: off
ERROR_LOG: off
```

From authors
------------
Expand Down
4 changes: 2 additions & 2 deletions container-files/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ http {
fastcgi_buffer_size 512k;
fastcgi_buffers 16 512k;

access_log /dev/stdout;
error_log /dev/stderr info;
access_log {{ ACCESS_LOG }};
error_log {{ ERROR_LOG }} info;

# should be enabled on gateway
gzip off;
Expand Down

0 comments on commit c4994ac

Please sign in to comment.