Application logs are sent using Rsyslog

Source: Internet
Author: User
Tags rsyslog

Rsyslog By default can only transfer the system log, such as Dhcp,cron, now to send a service log to the remote Rsyslog server, how to do it?

Workaround: To use the Rsyslog imfile module.

Reference official url:http://www.rsyslog.com/doc/v8-stable/configuration/modules/imfile.html

Reference online URL:HTTP://WWW.TUICOOL.COM/ARTICLES/JV2EUVN


Rsyslog configuration file (the content of the comment is filtered out):

[Email protected] ~]# cat/etc/rsyslog.conf | Egrep-v "#|^$"
$ActionFileDefaultTemplate Rsyslog_traditionalfileformat
$IncludeConfig/etc/rsyslog.d/*.conf
*.info;mail.none;authpriv.none;cron.none/var/log/messages
authpriv.*/var/log/secure
Mail.*-/var/log/maillog
Cron.*/var/log/cron
*.emerg *
Uucp,news.crit/var/log/spooler
local7.*/var/log/boot.log
$ModLoad Imfile
$InputFileName/usr/local/pf/logs/packetfence.log
$InputFileTag packetfence:
$InputFileSeverity Info
$InputFileStateFile stat-packetfence
$InputFileFacility LOCAL5
$InputFilePollInterval 1
$InputFilePersistStateInterval 1
$InputRunFileMonitor
local5.* @10.64.41.223:514
[Email protected] ~]#

After modifying the configuration file, restart the service

[Email protected] ~]#/etc/init.d/rsyslog restart
Shutting down system logger: [OK]
Starting system logger: [OK]
[Email protected] ~]#

The red font is a new configuration for transferring /usr/local/pf/logs/packetfence.log to 10.64.41.223:514.


Application logs are sent using Rsyslog

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.