How to tail (follow) Linux Service Logs

One of the most common tasks during Linux troubleshooting and software development sessions is following service logs on a Linux system.

0:00 Introduction
0:17 Example Service (“unit”): nginx
0:29 journalctl -fu nginx
0:33 -u (unit)
0:53 -f (follow)
1:24 Live Tail Example
1:43 pre-systemd equivalent (tail)
2:10 binary journald logs
2:45 Additional documentation

Welcome to the Library

Free Linux Sysadmin Course Playlist: https://www.youtube.com/playlist?list=PLtK75qxsQaMLZSo7KL-PmiRarU7hrpnwK

Check out my step-by-step project-based Linux course for beginners, 93% off when you use this link: https://www.udemy.com/hands-on-linux-self-hosted-wordpress-for-linux-beginners/?couponCode=TL-YOUTUBE

Patreon: https://www.patreon.com/tutorialinux
Official Site & e-mail list: https://tutorialinux.com/
Twitter: https://twitter.com/tutorialinux
Facebook: https://www.facebook.com/tutorialinux
Podcast: http://kernelpanicpodcast.com

source by tutoriaLinux

linux web server

Léa LOPEZ

Léa LOPEZ, Telecom System Administrator, Ambala College of Engineering and Applied Research, Ambala (INDIA)

17 thoughts on “How to tail (follow) Linux Service Logs

  • May 4, 2021 at 8:10 am
    Permalink

    Great channel! Q: what Linux do you use in your videos? minubuntu on oracle VM? where do you download minibuntu ?

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    journalctl -u nginx | less # maybe +F (command line or in less) so you can search and scrooll back or watch more output as it comes (as with -f)

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    Nice! I really should take the time to learn the Linux journal a little better. I was just running “watch -n1 systemctl status nginx” before, however this way is clearly how the cool kids do it 😎

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    Terminator is a great terminal (for me the best terminal) that you can split in multiples views. It would have been useful for this video to show the 2 views simultaneously.

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    I often use journalctl -eb -1 to show the end of last session log. To see at what time my system shutdown.

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    I take these things a step further – I pipe the output through a filter and then push it to an MQTT queue so that it can be acted on if necessary. Lets you have responsive events based on things happening which can be handy.

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    Hi! This only replaces syslog/rsyslog, isn't it? I mean, the access.log files are cat'ed the old way?

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    Me watching video while using sysklogd:
    Hmm… Interesting 🧐

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    Journalctl almost always messes up my terminal when I'm not following the logs and just paging through. Do you have any additional tips that I could use Dave?
    Or is there a way where I could open the journal without the -f and then midway start following?

    Like in "less" where you can just say Shift+F (something I learnt from your older video) and automatically start following the logs?

    Also, keep up the wonderful style of your videos. Love the general music, vibe and subtle humour 🙂

    Reply
  • May 4, 2021 at 8:10 am
    Permalink

    Came for the tips, stayed for the smooth, easy listening

    Reply

Leave a Reply

Buca escort