Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of syslogd in Linux system service

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the use of syslogd in Linux system services, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.

Introduction to the syslogd daemon:

A lot of things happen at the same time, especially when the network service is disconnected in the terminal window. Therefore, it is necessary to provide a standard mechanism for logging special events and messages. Linux uses the syslogd daemon to provide this service.

The syslogd daemon provides a standard way to log system activity and messages. Many other types of Unix operating systems also use compatible daemons. This provides a way to record across platforms in the network. In a large network environment, this is more valuable.

The record files used by syslogd to save data are concise text files, usually stored in the / var/ log subdirectory. Each data item consists of a row, including the date, time, hostname, process name, PID of the process, and messages from the process. A global function in the standard C function library provides a simple mechanism for generating recorded messages. If you don't like writing program code, but want to generate data items in a record file, you can choose to use the Logger command. As you can imagine, an important tool like syslogd should be started as part of the boot command script. Any linux distribution you plan to use in the server environment is already set up for you.

1. Call syslogd

If you need to start syslogd manually, or if you need to modify the command script that starts it when booting, you must pay attention to the command line parameters of syslogd. Please refer to the relevant books, which will not be described in detail here.

2./etc/syslog.conf file

The / etc/syslog.conf file contains the configuration information that syslogd needs to run. The format of this file is somewhat unusual, but the existing default configuration file will be sufficient, unless you need to find specific information in a specific file, or you need to send that information to a remote recording computer.

Classification of record information

Before we can master the / etc/syslog.conf file format itself, we need to understand how recorded messages are classified. Each message has a function value (Facility) and a priority value (Priority). The function value tells us which subsystem the message was generated by, while the priority value tells us how important the message is. These two values are separated by periods and both have equivalent strings, making them easy to remember.

Format of / etc/syslog.conf file

The following is the format of the statements in the configuration file:

Facility/priority combinations separated by commas file

/ process/host to log to

Examples are as follows:

Kern.info / ver/log/kerned

Syslogd also has the flexibility to send recorded messages to a variety of different save destinations. It can save the message as a file, send it to a FIFO queue, send it to a group of users, or (in the case of a message being logged in a large site centrally) to a central logging host. To distinguish between these destinations, the following rules are used at the destination entrance:

1. If the start character of the save destination is a slash character (/), the message will be sent to a file.

two。 If the start character of the save destination is a vertical character (|), the message is sent to a FIFO queue.

3. If the start character of the save destination is the "@" character, the message will be sent to a host.

Thank you for reading this article carefully. I hope the article "what is the use of syslogd in Linux system Services" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report