systemd generates services logs to the syslog by default (/var/log/messages). Unless logging is explicitly turned off for a specific service, all output written to stderr/stdout of a service goes to syslog. I have created a simple systemd service file for a custom application. The script works well when I run it manually and I am able to get logs on console. But I get the logs in syslog when I run it with systemd/service even when I’m directing them explicitly to the syslog and console.
I’m trying to track down where my problem is, but I don’t know where to find the output (or how to configure systemd to put the output on console).
Here is my service file which is on the path /etc/systemd/system/:
Description=SYSV: Control Server watchdog
Throughout the application, I output all my logs to stdout and stderr.
my query is “how can I redirect the output of my daemon to the console?”
If in the Unit file I have used
then in this case I get the Output on the Console but In this case we will get the output to the particular terminal which have the tty “/dev/pts/0”.
I have tried given scenarios but none worked for me:
Try to /etc/systemd/system.conf file
and restart the service by command - systemctl restart systemd-journald