课程: Linux: Kernels and Logging for System Administration

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Use rsyslog actions

Use rsyslog actions

- [Instructor] An Rsyslog rule consists of the selector on the left that contains a filter and priority, and on the right is the action. For this video, I will focus entirely on the action. For every Rsyslog filter, there is an Rsyslog log action. The action for a log filter usually involves saving the log message to a file. For instance, in this case, all cron messages are saved to /var/log/cron.log. As this line is written, this file is synchronized on every write. This can create a lot of overhead if there are a lot of writes to the log. To keep from sinking the file system every time the log is written, you can proceed the path with a dash. Beware that the data is held in RAM since it's not run to the disc right away. This opens the possibility that you may lose data if the server shuts down unexpectedly. Paths for logs can either be static, as we saw in our previous example, or dynamic. With a dynamic path, you create a template and then use that template name prefixed with a…

内容