Syslog-ng+rsyslog Collection log: Logrotate log cut, poll (vii)

Source: Internet
Author: User
Tags syslog rsyslog

Many software comes with cutting logs, such as Tomcat, which can be named by time. Rsyslog can generate files by date, but does not support "% $year%-% $month%-% $day%" These variables to read the file (current version number: rsyslog-8.17.0-1.el6.x86_64).


Then, you need to use the log polling logrotate.

    1. overview, configuration.

      Global configuration:/etc/logrotate.conf

      Local configuration:/etc/logrotate.d/for ease of administration, custom configurations are put into/etc/logrotate.d/

    2. Use.

      Create file tomcat-log.conf, this file name can be random, you can have no suffix.

Vi/etc/logrotate.d/tomcat-log.conf
#tomcat里catalina. Out log path/tomcat/logs/catalina.out {#按天执行 daily #按日期保存旧文件 dateext #最多5个备份 rotate 5 #忽略错误 mi Ssingok #日志为空, do not poll notifempty #创建指定用户和权限的文件 while logrotate modify old file name create 644 root}

Reference article:

Http://linux.cn/article-4126-1.html

Http://blog.csdn.net/cjwid/article/details/1690101


This article is from the "Enlightened Grocery store" blog, please be sure to keep this source http://wutou.blog.51cto.com/615096/1767968

Syslog-ng+rsyslog Collection log: Logrotate log cut, poll (vii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.