systemd's logging of stdout/stderr not visible on console

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/:

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/watchdog
Description=SYSV: Control Server watchdog
Before=multi-user.target graphical.target

[Service]
Type=forking
Restart=no
TimeoutSec=5m
RemainAfterExit=no
ExecStart=/etc/init.d/watchdog start
ExecStop=/etc/init.d/watchdog stop
StandardOutput=syslog+console
StandardError=syslog+console

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?”

Note:

If in the Unit file I have used

StandardOutput=tty and
TTYPath=/dev/pts/0

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:

  1. Try to /etc/systemd/system.conf file
    change: DefaultStandardOutput=syslog+console

  2. In /etc/systemd/system/watchdog.service
    StandardOutput=tty
    TTYPath=/dev/tty

  3. In /etc/systemd/system/watchdog.service
    StandardOutput=inherit

  4. In /etc/systemd/system/watchdog.service
    StandardOutput=journal+console

  5. In /etc/systemd/system/watchdog.service
    StandardOutput=fd

  6. In /etc/systemd/system/watchdog.service
    StandardOutput=console

  7. In /etc/systemd/system/watchdog.service
    StandardOutput=tty
    TTYPath=/dev/tty0

  8. In /etc/systemd/jornald.conf
    ForwardToConsole=yes
    and restart the service by command - systemctl restart systemd-journald

sandeepAricent,

It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.

These forums are peer-to-peer, best effort, volunteer run and that if your issue
is urgent or not getting a response, you might try one of the following options:

Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.suse.com/faq.php

If this is a reply to a duplicate posting or otherwise posted in error, please
ignore and accept our apologies and rest assured we will issue a stern reprimand
to our posting bot…

Good luck!

Your SUSE Forums Team
http://forums.suse.com