ok systemd experts, how the heck do I get the output of a oneshot container with LogDriver=passthrough into both journald _and_ a regular log file that's rotated daily? Similar use case as described here https://github.com/systemd/systemd/issues/38684#issuecomment-3221956220

I need simple log files for long term archiving

In the old world I'd just do "./program | tee -a /logs/$(date +%Y%m%d.log)"

Rotate StandardOutput= file when rotating logs · Issue #38684 · systemd/systemd

Component journalctl, systemd Description The most efficient way to write daemon logs into a specific file is using: [Service] StandardOutput=append:/var/log/xxx.log StandardError=append:/var/log/x...

GitHub

I solved it by adding the following to the .container file:

ExecStopPost=/bin/sh -c '/usr/bin/journalctl -u rrdp-sync.service --invocation 0 >> /data/logs/$$(date +%%Y%%m%%d).log'

Thanks @jaseg for the hint