title: How to see the systemd service logs in Ubuntu
body: <p>I have a below service file:</p>
  <pre><code>[Unit]
  Description=demo service
  Requisite=mosquitto.service
  BindsTo=mosquitto.service
  
  [Service]
  Type=simple
  ExecStart=/usr/bin/python3 /home/john/Documents/source/demo.py
  Restart=on-failure
  RestartSec=30s
  StandardOutput=null
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  <p>This <code>demo.service</code> simply calls a python code <code>demo.py</code>. When I am starting the service using <code>sudo systemctl start demo.service</code>, it always remains in <code>auto-restart(failure)</code> mode.</p>
  <pre><code>demo.service - demo service
     Loaded: loaded (/etc/systemd/system/demo.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2020-08-17 12:13:37 BST; 23s ago
    Process: 4744 ExecStart=/usr/bin/python3 /home/john/Documents/source/demo.py
   Main PID: 4744 (code=exited, status=1/FAILURE)
  </code></pre>
  <p>I have checked <code>syslog</code> but there is no useful information in them. It just shows demo service started and demo service stopped logs.</p>
  <p>From where can I get its logs to understand why the service is not starting. Please help. Thanks</p>
  <p>Below are the logs from <code>journactl</code>:</p>
  <pre><code>Aug 13 13:51:40 john systemd[1]: Started demo service.
  Aug 13 13:51:40 john systemd[1]: demo.service: Main process exited, code=exited, status=1/FAILURE
  Aug 13 13:51:40 john systemd[1]: demo.service: Failed with result 'exit-code'.
  Aug 13 13:52:10 john systemd[1]: demo.service: Service hold-off time over, scheduling restart.
  Aug 13 13:52:10 john systemd[1]: demo.service: Scheduled restart job, restart counter is at 2.
  Aug 13 13:52:10 john systemd[1]: Stopped demo service.
  </code></pre>