Linux Server program specification

Source: Internet
Author: User
Tags syslog system log

Linux system logs

Server commissioning and maintenance require a professional log system. Linux provides a daemon (SYSLOGD) to handle the system log, and now it is using its upgraded version (RSYSLOGD) on the Linux system.

The RSYSLOGD daemon can receive both the log of the user's process output and the kernel log.

The user process generates the system log by invoking the Syslog function. The function outputs the log to a UNIX local domain socket type (af_unix) file/dev/log, Rsyslogd listens to the file to get the output of the user process.

The kernel log is printed into the ring buffer of the kernel by functions such as PRINTK. The contents of the ring cache are mapped directly to the/proc/kmsg file. RSYSLOGD gets the kernel log by reading the file.

After the RSYSLOGD daemon receives a log of the user process or kernel input, it outputs them to some specific log files. By default, the debug information is saved to the/var/log/debug file, the normal information is saved to the/var/log/messages file, and the kernel information is saved to the/var/log/kern.log file. The details of how the log information is distributed can be set in the RSYSLOGD configuration file (/etc/rsyslog.conf).

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/42/C2/wKioL1PYwTqiW6_WAACFFTzoM9E430.jpg "title=" Qq20140730175100.png "alt=" Wkiol1pywtqiw6_waacfftzom9e430.jpg "/>

syslog function

The application uses a syslog function to communicate with the RSYSLOGD daemon.

#include <syslog.h>

void syslog (int priority, const char* message, ...);




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.