博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
syslog配置文件总结
阅读量:7144 次
发布时间:2019-06-29

本文共 1933 字,大约阅读时间需要 6 分钟。

一、syslog介绍

Syslog常被称为系统日志或系统记录,是一种用来在互联网协定(TCP/IP)的网络中传递记录当前信息的标准

二、syslog配置文件参数解释

一般配置文件位于/etc/syslog.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@svn ~]
# cat /etc/syslog.conf
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;
cron
.none                
/var/log/messages
# The authpriv file has restricted access.
authpriv.*                                              
/var/log/secure
# Log all the mail messages in one place.
mail.*                                                  -
/var/log/maillog
# Log cron stuff
cron
.*                                                  
/var/log/cron
# Everybody gets emergency messages
*.emerg                                                 *
# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          
/var/log/spooler
# Save boot messages also to boot.log
local7.*                                                
/var/log/boot
.log

1
#kern.*                                                 /dev/console

#内核产生的所有日志  记录到终端设备文件中

1
*.info;mail.none;authpriv.none;
cron
.none               
/var/log/messages

#所有级别的info,但是不包括authpriv  cron mail的日志信息,这里的none表示不包括的意思

1
2
# The authpriv file has restricted access.
authpriv.*                                              
/var/log/secure

#安全信息相关日志,此日志的文件权限相当重要

1
2
# Log all the mail messages in one place.
mail.*                                                  -
/var/log/maillog

#mail相关日志记录,,为了保证日志信息的可用性,一般日志是同步写到磁盘当中去,横线为异步同步到硬盘,所以信息会先写到内存当中,再写到硬盘中

1
2
# Log cron stuff
cron
.*                                                  
/var/log/cron

#计划任务信息所存放的日志路径

1
2
# Everybody gets emergency messages
*.emerg                                                 *

#紧急情况日志,*代表所有用户

1
2
# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          
/var/log/spooler
1
2
# Save boot messages also to boot.log
local7.*                                                
/var/log/boot
.log

#系统启动日志存放路径

三、举例

1
mail.info 
/var/log/mailog
1
mail.info  :

#包括这个级别和这个级别高的所有级别产生的信息

1
mail.=!info :

#只记录info这个信息,其他不做记录

1
mail.!=info :

#除了info其他的级别,与mail.info /var/....相反

1
mail.*

#所有的信息

#如果将多个指定信息记录的日志输出到某日志当中,可以使用;号进行表示,如:

1
cron
.info;mail.error 
/var/log/mes
.log

#如果想记录mail所有级别信息,但除了info:

1
mail.*;mail.!=info  
/var/log/xxx
.log
本文转自zuzhou 51CTO博客,原文链接:http://blog.51cto.com/yijiu/1238842

转载地址:http://mrwgl.baihongyu.com/

你可能感兴趣的文章
Java之注解
查看>>
PHP响应式VIP电影影视系统源码 带自动采集和会员管理系统
查看>>
iframe里弹出的层显示在整个网页上
查看>>
开源项目Bug悬赏任务
查看>>
ubuntu 和 win10 双系统安装 及 pyopengl 环境配置修改
查看>>
学习计划书
查看>>
为什么你的智能手表功能这么多,ICMAX来解答
查看>>
tor_api
查看>>
给国外电子邮箱发海外邮件用什么邮箱好?
查看>>
Connectify+Wireshark捕获手机APP的数据包
查看>>
CentOS 6.5 生产环境编译安装LNMP
查看>>
8.6 “数据库设置”服务器选项
查看>>
两种方法反转单链表
查看>>
二叉树递归前序、中序、后序遍历
查看>>
在VIEW中加载UICollectionView
查看>>
散列桶
查看>>
eclipse修改 服务器默认路径
查看>>
[iOS Animation]-CALayer 视觉效果
查看>>
8 步搭建 Node.js + MongoDB 项目的自动化持续集成
查看>>
windowsserver 2012 R2 创建群集失败
查看>>