Skip to content

Commit

Permalink
add note about redirecting logs to syslog
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcooke committed Mar 11, 2024
1 parent 6f105f9 commit 260c88b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions content/3.features/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ category: Features

All Postal processes log to STDOUT and STDERR which means their logs are managed by whatever engine is used to run the container. In the default case, this is Docker.

## Redirecting logs to the host syslog

If you want to send your log data to the host system's syslog then you can configure this. This is useful if you wish to use external tools like `fail2ban` to block users from accessing your system.

The quickest way to achieve this is to use a docker compose overide file in `/opt/postal/install/docker-compose.overide.yml`. The contents of this file, would contain the following:

```yaml
version: "3.9"
services:
smtp:
logging:
driver: syslog
options:
tag: postal-smtp
```

If you wanted to put worker and web server logs there too, you can define those. The example above demonstrates using the `smtp` server process.

## Limiting the size of logs

Docker cam be configured to limit the size of the log files it stores. To avoid storing large numbers of log files, you should configure this appropriately. This can be achieved by setting a maximum size in your `/etc/docker/daemon.json` file.
Expand Down

0 comments on commit 260c88b

Please sign in to comment.