I have a program that logs to two configurable logfiles. The file names are given in a configuration file, and not via command line parameter (which is the case in this similiar question). How can I get the log output to show up in the systemd journal (journalctl)?
I can imagine either systemd would monitor the logfile, or I create a unix socket and use that as my logfile? This seems a common use case, is there a directive in the service file I need to know?
I am hesitant to just use /dev/stdout as the filename, as I'm not sure the process will deal with it correctly. And I can't use bash process substitution (myapp --log-file >(systemd-cat)
) as the log file is not passed via command line.
In case it matters, the program is the IBM DSM client (formerly TSM), and I'm right now using the original systemd service file.
0 Answers