1 00:00:07,530 --> 00:00:12,530 - So our rsyslog configuration is in etc/rsyslog.conf. 2 00:00:14,040 --> 00:00:15,993 And we need to add a line, 3 00:00:16,980 --> 00:00:19,260 regardless of what we already have, 4 00:00:19,260 --> 00:00:23,400 we can add another line to log the same information. 5 00:00:23,400 --> 00:00:27,080 So we want all messages, all priorities, that's easy. 6 00:00:27,080 --> 00:00:30,960 *.* for all facilities, all priorities. 7 00:00:30,960 --> 00:00:35,160 And we write that to var/log/all. 8 00:00:35,160 --> 00:00:36,990 There was one more requirement, 9 00:00:36,990 --> 00:00:41,990 and this requirement is that we need the imjournal module. 10 00:00:42,330 --> 00:00:45,030 There we go, imjournal is already there. 11 00:00:45,030 --> 00:00:47,790 So further requirement that system d, journal d, 12 00:00:47,790 --> 00:00:49,620 is used as log inputs. 13 00:00:49,620 --> 00:00:51,570 We don't have to do anything. 14 00:00:51,570 --> 00:00:54,933 This rsyslog has been configured to do so automatically. 15 00:00:56,190 --> 00:01:00,870 Next systemctl restart rsyslog to restart 16 00:01:00,870 --> 00:01:02,520 so that it's picking it up. 17 00:01:02,520 --> 00:01:05,883 And now we need to create the logrotate. 18 00:01:07,350 --> 00:01:09,270 So how do we do that? 19 00:01:09,270 --> 00:01:11,940 Well, let's get a little bit of inspiration 20 00:01:11,940 --> 00:01:16,080 through etc/logrotate.d 21 00:01:16,080 --> 00:01:18,630 and just pick out any of these, 22 00:01:18,630 --> 00:01:20,910 httpd for instance. 23 00:01:20,910 --> 00:01:22,980 And there we can see how it works. 24 00:01:22,980 --> 00:01:25,530 So we have var/log name of the file 25 00:01:25,530 --> 00:01:28,330 and then we have the parameters between square brackets. 26 00:01:29,580 --> 00:01:32,550 So if we combine that 27 00:01:32,550 --> 00:01:37,293 with what we see in etc/logrotate.conf, 28 00:01:38,280 --> 00:01:39,390 there we have the parameters. 29 00:01:39,390 --> 00:01:40,920 So I need these weekly 30 00:01:40,920 --> 00:01:45,920 and this rotate six in inner configuration. 31 00:01:47,220 --> 00:01:50,390 That looks a little bit like what we see here. 32 00:01:50,390 --> 00:01:54,390 Now the easy way would be to use etc/logrotate.d. 33 00:01:55,800 --> 00:02:00,800 And let me copy this httpd to all, 34 00:02:03,750 --> 00:02:06,390 and let me edit the all file. 35 00:02:06,390 --> 00:02:10,593 And in this all file, I am going to configure var/log/all. 36 00:02:13,980 --> 00:02:18,513 And I want to set that to daily and to rotate six. 37 00:02:24,810 --> 00:02:26,823 And everything else can be deleted. 38 00:02:29,730 --> 00:02:31,590 And now it will be picked up the next time 39 00:02:31,590 --> 00:02:33,810 that logrotate is going to run. 40 00:02:33,810 --> 00:02:35,193 So that's how it works.