Tag: journalctl

  • journalctl

    To see systemd logs, run

    journalctl -f
    

    To see a service specific logs (example postfix)

    journalctl -f -u postfix
    

    To see logs for a specific service, run

    journalctl --unit apache2
    

    Logs with out pagination

    journalctl --no-pager -u nginx
    
    journalctl -u lxc-net.service -n 30
    

    See systemd

  • Systemd Journal

    Systemd have its own loggin system called Systemd Journal. It keep track of logs for each service.

    To see log for a service, run

    journalctl -u SERVICE_NAME
    

    Example

    root@ocp-serverok-in:~# journalctl -u myapp
    -- Logs begin at Wed 2020-05-27 06:43:34 UTC, end at Fri 2020-06-26 09:33:19 UTC. --
    Jun 26 08:53:59 ocp-serverok-in systemd[1]: Started Sample web server.
    Jun 26 08:53:59 ocp-serverok-in cat[36147]: Starting web server
    root@ocp-serverok-in:~#