Linux Log Server rsyslog and linux Log rsyslog

Source: Internet
Author: User
Tags rsyslog

Linux Log Server rsyslog and linux Log rsyslog

In Linux, rsyslog can be used to centrally manage system logs. In this case, there is usually a log server, and each machine configures its own logs to be written to a remote log server through rsyslog.

Assume that there are two servers, one as the System Log Server (such as the machine name logmaster) and the other as the log client (such as the machine name logclient)

Log Server Configuration

First, modify the/etc/rsyslog. conf file on the log master machine and uncomment the following four lines.

$ModLoad imudp$UDPServerRun 514$ModLoad imtcp$InputTCPServerRun 514

Then restart the rsyslogd service.

$ sudo /etc/init.d/rsyslog restart
Log client Configuration

Modify the/etc/rsyslog. conf file on the log node machine.
Add the following lines at the end to allow Linux to write logs to the remote log mater machine at the same time.

*.*         @logmaster

Then restart the rsyslogd service.

$ sudo /etc/init.d/rsyslog restart
Test

You can use the logger command on Linxu to write a system log, for example

$ logger 'hello world'

Then, view the/var/log/messages file on the log master machine.

Jun 28 14:58:16 logclient root: hello world

It includes the date, log source (machine name), process name, and log Content.

Reprinted please mark the address of this article as a link
Address: http://blog.csdn.net/kongxx/article/details/46671575

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.