I have an application on the isolated machine. It writes logs to /var/log/app/log.txt for example. However, I want it to write logs to journald daemon. However, I can't change the way application run, because it is encapsulated.
I mean I can not do smth like app | systemd-cat
1) Am I right that all services started with systemd write logs to journald?
2) If so, will the children of process, started by systemd, will also write logs to journald?
3) Is there any way to tell journald to take logs from a specific file?
4) If not, are there any workarounds?
AbdulKareem :
warning: this is not tested\n\nYou could mount bind /dev/stdout to log file in ExecStartPre\n\nExample:\n\nExecStartPre=/use/sbin/mount --bind /dev/stdout /var/log/app/log.txt\n\n\nOr soft link /dev/stdout to log file in ExecStartPre\n\nExample:\n\nExecStartPre=/use/bin/ln -s /dev/stdout /var/log/app/log.txt\n",
2017-02-24T17:10:33