etherpad: redirect container logs

Redirect etherpad container logs via rsyslogd to /var/log/containers,
which is rotated by default.  This avoids some issues we've seen with
the journal becoming too big.

Change-Id: Id557b9265e30acdb2ca09631dbedf034f85a700f
This commit is contained in:
Ian Wienand 2022-11-09 06:48:04 +11:00
parent 3b60679d6b
commit 535757551c
No known key found for this signature in database
2 changed files with 17 additions and 0 deletions

View File

@ -15,11 +15,19 @@ services:
volumes:
- /var/etherpad/db:/var/lib/mysql
- /etc/etherpad/mysql:/etc/mysql/conf.d
logging:
driver: syslog
options:
tag: "docker-mariadb"
etherpad:
restart: always
image: docker.io/opendevorg/etherpad
network_mode: host
environment:
NODE_ENV: production
logging:
driver: syslog
options:
tag: "docker-etherpad"
volumes:
- /etc/etherpad/settings.json:/opt/etherpad-lite/settings.json

View File

@ -25,3 +25,12 @@ def test_etherpad_robots(host):
'--resolve etherpad.opendev.org:443:127.0.0.1 '
'https://etherpad.opendev.org/robots.txt')
assert 'Disallow: /' in cmd.stdout
def test_etherpad_logs(host):
etherpad_log_file = host.file('/var/log/containers/docker-etherpad.log')
assert etherpad_log_file.exists
assert etherpad_log_file.contains('Etherpad is running')
mariadb_log_file = host.file('/var/log/containers/docker-mariadb.log')
assert mariadb_log_file.exists
assert mariadb_log_file.contains('mysqld: ready for connections')