1
00:00:00,000 --> 00:00:11,200
In this video, you'll learn about the logger command. Logger is a command that you can

2
00:00:11,200 --> 00:00:18,160
use to write messages to your standard journaling solution. So it works with systemd journald,

3
00:00:18,160 --> 00:00:23,540
it also works with rsyslog, and it's convenient if you want to write a message from a script.

4
00:00:23,540 --> 00:00:27,480
Because maybe your script is generating an error condition that you want to be logged,

5
00:00:27,480 --> 00:00:33,220
well, logger is what you are going to do. You can use it with the option minus p followed

6
00:00:33,220 --> 00:00:39,900
by a priority to even send messages with a specific priority. Let me show you. So I'm

7
00:00:39,900 --> 00:00:50,419
using logger minus pr. Hello, folks. And that should be doing it. So journalctl uppercase

8
00:00:50,419 --> 00:00:56,860
G is showing me in red. Hello, folks. Now to get a little bit more detail, you might

9
00:00:56,860 --> 00:01:05,500
also want to use journalctl minus pr so that you can see all errors. And there we can see

10
00:01:05,500 --> 00:01:10,720
that my logger command is nicely added to it. And that's really all there is to know

11
00:01:10,720 --> 00:01:13,500
about the logger command. It's very straightforward.

