Forward logs from file to journald

logssystemdsystemd-journald

I have an application that writes logs to some file e.g. /var/log/mylog.txt

However, I want it to be written to journald (so that it can be accessed via journalctl). I can't change way of launching of application, as it is encapsulated from me.

Any ideas?

Best Answer

You could use systemd-cat, e.g.

 systemd-cat cat /path/to/log

or

 systemd-cat -t encapsulated_app_log tail -f /path/to/log
Related Question