syslog-ng

2023-05-16

syslog-ng配置

March 13th, 2012
绚丽也尘埃 Leave a comment
Go to comments

syslog-ng的配置非常简单直观,于是乎配置好看看怎么用它实时收集日志。有两台服务器,一台服务器盯着error_log文件,一旦发现其有新数据,立即将日志发到另一台收集服务器。

client服务器配置如下。

?
1
2
3
4
5
6
7
8
9
#将文件作为src
source s_blender_error_log {
        file("/home/admin/kingso/logs/error_log_blender");
};
#收集到的日志发送给172.25.61.92
destination d_blender_error_log { tcp("172.25.61.92" port(514)); };
log { source(s_blender_error_log); destination(d_blender_error_log);};

server服务器配置如下。

?
01
02
03
04
05
06
07
08
09
10
11
#监听514端口
source s_kingso {
        tcp(ip(0.0.0.0) port(514));
};
#设置输入文件及其相关的属性
destination d_kingso {
        file("/home/admin/error.log" owner(admin) group(admin) perm(0755));
};
log { source(s_kingso); destination(d_kingso); };

最后收集到的日志如下。

?
1
Mar 13 20:32:56 s061090.cm5 moximoximoximoximoxi

syslog-ng有一个很有意思的功能,那就是在destination里面支持program,可以对符合条件的日志支持操作,比如报警等等。下面这个配置会将所有包含error的日志输出到一个指定的文件中。为了提高性能,建议这个程序从标准输入读入数据,如果没有数据就阻塞等待,不要轻易退出。

?
1
2
3
destination d_kingso {
        program("grep error >> /tmp/eerroorr.log");
};

filter支持内容过滤,比如要把服务器上所有core信息都收集到一台服务器上,只要判断kern信息中是否有segfault就可以,配置如下。

?
1
2
3
4
filter f_kingso_core {
    facility(kern) and
    match("segfault" value("MESSAGE"));
}

如果要用syslog-ng收集大集群的日志,需要设置下max-connections这个参数,它的默认值是10,实在是太小了。如果不改这个配置,netstat会出现syslog-ng导致的大量TIME_WAIT。将其放大之后,可以算一下ESTABLISHED的链接数是不是和集群服务器数量相同。

syslog-ng服务器默认情况下收集到的日志是:”Apr 1 17:42:33 hostname blabla”。月份后面可能有一个空格(大于10号)也可能有两个空格(小于10号),这样对消息的切分就会有问题,这个时候必须通过template来规范消息的格式。syslog-ng支持定义一个template模版,以后的template都可以使用改模版,非常方便。下面这个配置就是program和file两个destination共用一个t_kingso模版。

?
1
2
3
4
5
6
template t_kingso { template("$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC\t$FULLHOST\t$MSGHDR$MSG\n"); };
destination d_kingso_blender {
    program("exec python -u /home/henshao/log_monitor/log_monitor.py -c /home/henshao/log_monitor/log_monitor.conf -m blender >> /tmp/log_monitor.log 2>&1" template(t_kingso) );
    file( "/home/admin/logs/blender.log.$S_YEAR-$S_MONTH-$S_DAY" create_dirs(yes) owner(admin) group(admin) perm(0755) template(t_kingso) );
};

我发现RHEL5上默认安装了syslogd、syslog-ng和rsyslog。syslogd历史最为悠久,wikipedia上的资料上讲它当初是sendmail项目的一部分,因为非常有用,所以逐渐成为所有unix-like系统的标准组件。syslog-ng则是syslogd的升级版本,是一个公司开发的,除了开源免费版还有收费的高级版,有一篇不错的文章: 专访syslog-ng 2.0开发人员Balazs Scheidler。rsyslog则最为年轻,作者想做一个log系统和syslog-ng竞争。

推荐一些不错的资料。

1、Syslog-ng

2、syslog-ng v2.0 reference manual

 

 

 

Syslog-ng安装及配置(2010-04-26 13:37:46)

转载
标签:

杂谈

分类: linux

注:当前使用版本为syslog-ng-2.0.9
//使用以下RPM或是使用eventlog的源码包
rpm -ivh eventlog-0.2.5-1.el5.i386.rpm
rpm -ivh eventlog-devel-0.2.5-1.el4.i386.rpm
./configure --prefix=/usr/local/syslog-ng --sysconfdir=/etc
make && make install
mkfifo /tmp/mysql.pipe  //创建mysql管道,接收到的日志写入该管道,通过期写入Mysql
chkconfig --add syslog-ng
chkconfig syslog-ng on
chkconfig --add sqlsyslogd
chkconfig sqlsyslogd on
web界面采用php-syslog-ng来查看日志
以下是所用到的配置文件及服务文件
Syslog-ng.conf配置文件
/etc/syslog-ng.conf
#
# configuration file for syslog-ng, customized for remote logging
#
source s_internal { internal(); };
destination d_syslognglog { file("/var/log/syslog-ng.log"); };
log { source(s_internal); destination(d_syslognglog); };
# Local sources, filters and destinations are commented out
# If you want to replace sysklogd simply uncomment the following
# parts and disable sysklogd
#
# Local sources
#
#source s_local {
    unix-dgram("/dev/log");
    file("/proc/kmsg" log_prefix "kernel:");
#};
#
# Local filters
#
#filter f_messages { level(info..emerg); };
#filter f_secure { facility(authpriv); };
#filter f_mail { facility(mail); };
#filter f_cron { facility(cron); };
#filter f_emerg { level(emerg); };
#filter f_spooler { level(crit..emerg) and facility(uucp, news); };
#filter f_local7 { facility(local7); };
#
# Local destinations
#
#destination d_messages { file("/var/log/messages"); };
#destination d_secure { file("/var/log/secure"); };
#destination d_maillog { file("/var/log/maillog"); };
#destination d_cron { file("/var/log/cron"); };
#destination d_console { usertty("root"); };
#destination d_spooler { file("/var/log/spooler"); };
#destination d_bootlog { file("/var/log/boot.log"); };
#
# Local logs - order DOES matter !
#
#log { source(s_local); filter(f_emerg); destination(d_console); };
#log { source(s_local); filter(f_secure); destination(d_secure); flags(final); };
#log { source(s_local); filter(f_maillog); destination(d_maillog); flags(final); };
#log { source(s_local); filter(f_cron); destination(d_cron); flags(final); };
#log { source(s_local); filter(f_spooler); destination(d_spooler); };
#log { source(s_local); filter(f_local7); destination(d_bootlog); };
#log { source(s_local); filter(f_messages); destination(d_messages); };
# Remote logging
source s_remote {
      tcp(ip(0.0.0.0) port(514));
      udp(ip(0.0.0.0) port(514));
};
options
{
chain_hostnames(no);
create_dirs (no);
dir_perm(0755);
dns_cache(yes);
keep_hostname(yes);
log_fifo_size(2048);
log_msg_size(8192);
long_hostnames(on);
perm(0644);
stats(3600);
sync(0);
time_reopen (10);
use_dns(yes);
use_fqdn(yes);
};
destination d_separatedbyhosts { pipe("/tmp/mysql.pipe" template("INSERT INTO logs
    (host, facility, priority, level, tag, datetime, program, msg)
    VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC','$PROGRAM', '$MSG' );\n") template-escape(yes)); };
log { source(s_remote); destination(d_separatedbyhosts); };
#----------------------------------------------------------------------
# Sources
#----------------------------------------------------------------------
# For Linux
#----------------------------------------------------------------------
source s_stream
{ unix-stream("/dev/log"); };
source s_internal
{ internal(); };
source s_kernel
{ pipe("/proc/kmsg" log_prefix("kernel: ")); };
source s_tcp
{ tcp(port(4800) keep-alive(yes) max_connections(100)); };
#----------------------------------------------------------------------
# Piping method
#----------------------------------------------------------------------
destination database { pipe("/tmp/mysql.pipe" template("INSERT INTO logs
    (host, facility, priority, level, tag, datetime, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC','$PROGRAM', '$MSG' );\n") template-escape(yes)); };
#----------------------------------------------------------------------
# Logging to a database
#----------------------------------------------------------------------
log { source(s_stream);
source(s_internal);
source(s_kernel); destination(database); };
syslog-ng服务文件
/etc/init.d/syslog-ng
###############################################################
#
# Program: syslog-ng init script for Red Hat
#
###############################################################
# the following information is for use by chkconfig
# if you are want to manage this through chkconfig (as you should), you must
# first must add syslog-ng to chkconfig's list of startup scripts it
# manages by typing:
#
# chkconfig --add syslog-ng
#
# DO NOT CHANGE THESE LINES (unless you know what you are doing)
# chkconfig: 2345 12 88
# description: syslog-ng is the next generation of the syslog daemon. \
# syslog-ng gives you the flexibility of logging not only by facility and \
# severity, but also by host, message content, date, etc. it can also replace \
# klogd's function of logging kernel messages
#
# This following block of lines is correct, do not change! (for more info, see
# http://www.linuxbase.org/spec/refspecs/...facilname.html)
### BEGIN INIT INFO
# Provides: $syslog
### END INIT INFO
###############################################################
#
# This is an init script for syslog-ng on the Linux platform.
#
# It totally relies on the Redhat function library and works the same
# way as other typical Redhat init scripts.
#
#
# Platforms (tested): Linux (Redhat 7.3)
#
#
# Author: Gregor Binder <gbinder@sysfive.com>
# Changed: October 10, 2000
#
# Last Changed: September 27, 2002
# Updated by: Diane Davidowicz
# changes: Brought the start script up to snuff as far as compliance
# with managing the startup script through chkconfig;
# added PATH variable ability to hook in path to syslog-ng (if
# its necessary); converted init script format to the
# standard init script format in Red Hat (7.3 to be exact)
# including using the /etc/sysconfig/syslog-ng file to
# managed the arguments to syslog-ng without changing this
# script, and disabled klogd but noted where and under what
# conditions it should be enabled. HAPPY LOGGING.
#
# Copyright &copy; 2000 by sysfive.com GmbH, All rights reserved.
#
#
###############################################################
#
# configuration
#
INIT_PROG="/usr/local/syslog-ng/sbin/syslog-ng" # Full path to daemon
INIT_OPTS="" # options passed to daemon
#
# Source Redhat function library.
#
. /etc/rc.d/init.d/functions
# Tack on path to syslog-ng if not already in PATH
SYSLOGNG_PATH=":/usr/local/syslog-ng/sbin"
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/syslog-ng/sbin
INIT_NAME=`basename "$INIT_PROG"`
# /etc/sysconfig/ is the standard way to pull in options for a daemon to use.
# Source config
if [ -f /etc/sysconfig/syslog-ng ] ; then
. /etc/sysconfig/syslog-ng
else
SYSLOGNG_OPTIONS=
fi
RETVAL=0
umask 077
ulimit -c 0
# See how we were called.
start() {
echo -n "Starting $INIT_PROG: "
#daemon $INIT_PROG $SYSLOGNG_OPTIONS
daemon --check $INIT_PROG "$INIT_PROG $INIT_OPTS"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch "/var/lock/subsys/${INIT_NAME}"
return $RETVAL
}
stop() {
echo -n "Stopping $INIT_PROG: "
killproc $INIT_PROG
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f "/var/lock/subsys/${INIT_NAME}"
return $RETVAL
}
rhstatus() {
status $INIT_PROG
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
rhstatus
;;
restart|reload)
restart
;;
condrestart)
[ -f /var/lock/subsys/syslog-ng ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload}"
exit 1
esac
exit $?
实时把日志导入数据库的服务文件
/etc/init.d/sqlsyslogd
#!/bin/bash
#
# sqlsyslogd This is a daemon that takes syslog-ng input and pipe it into
# a MySQL database.
#
# chkconfig: 2345 98 10
# description: sqlsyslogd bridges syslog-ng and mysql.
# author: Josh Kuo Thu 2004/08/12 13:21:56 PDT
. /etc/rc.d/init.d/functions
case "$1" in
start)
if [ -x /tmp/mysql.pipe ]; then
mkfifo /tmp/mysql.pipe
else
# if the service is already running, do not start another one
PIDS=`pidofproc mysql`
if [ "$PIDS" ]; then
echo "sqlsyslogd is already running."
exit 1
fi
mysql -u 用户名 -h localhost –p密码 数据名 < /tmp/mysql.pipe &
#If you need to collect apache logs into mysql, uncomment the following two lines.
#tail -f /usr/local/apache2/logs/access_log | logger -p info -t apache &
#tail -f /usr/local/apache2/logs/error_log | logger -p notice -t apache &
fi
;;
stop )
killproc mysql
#If you need to collect apache logs into mysql, uncomment the next line.
#killproc tail
;;
*)
echo "Usage: sqlsyslogd {start|stop}"
exit 1;
esac
exit 0;

 

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

syslog-ng 的相关文章

  • rsyslog无法发送日志到server端问题定位

    问题描述 网络正常的情况下 代码端中使用openlog无法正常将日志发往syslog服务器 即使使用logger也无法正常发送 环境 ARM设备充当client端 pc虚拟机Ubuntu充当server端 验证方式 通过wireshark抓
  • linux下的守护进程(daemon)和系统日志(syslog)

    目录 守护进程daemon 参数 编程示例 日志系统syslog 函数原型 openlog函数及其参数说明 打开系统日志 参数说明 参数说明 编程示例 守护进程daemon Unix Linux中的守护进程 Daemon 类似于Window
  • 日志分析系列之平台实现

    本系列故事纯属虚构 如有雷同实属巧合 平台实现前的说明 小B在给老板汇报了 统一日志分析平台 项目后 老板拍板立即开始做 争取下一次能及时发现攻击并且追踪攻击者 于是小B开始分析了市面上商业与开源的日志分析平台架构 大家都神似如下图 知道了
  • Linux 的 syslog_r?

    各位 我找不到适用于 Linux 的 syslog 的可重入版本 有吗 如果没有 你会怎么做 显而易见的答案是将日志记录工具移至单独的线程中并序列化对系统日志的访问 根据POSIX规范 syslog函数已经是线程安全的 因此在Linux中实
  • 如何让 php 错误显示在 syslog 上

    我有一个计划运行的脚本crontab 我注意到我在任何地方都看不到 php 错误 我希望能够看到登录的 php 错误 var log syslog或其他地方 我尝试过配置我的php ini记录错误 var log php errors lo
  • 有没有办法将系统日志消息重定向到标准输出?

    我有一个可以以两种模式运行的应用程序 使用 CLI 或作为守护程序 我在用syslog 用于记录 但是 当在 CLI 模式下运行时 我想要所有日志记录 除了那些标记的日志记录LOG DEBUG 消息发送到控制台而不是记录 我尝试过使用set
  • 有没有一种方法可以将对象强制转换回其原始类型而不指定每种情况?

    我有一个不同类型对象的数组 我使用 BinaryWriter 将每个项目转换为其二进制等效项 以便我可以通过网络发送该结构 我目前正在做类似的事情 for i 0 i
  • 修改HAProxy Lua库路径

    我正在尝试从 HAProxy 加载 Lua 脚本 在 Lua 脚本中 以下行导致错误 local http require socket http 最初我收集自journalctl xe输出表明该库未安装 我安装它使用luarocks in
  • 如何避免在控制台上打印系统日志的广播消息

    我编写了一段小代码 用于在连接到 postgres 数据库失败时使用 C Api 向系统日志发送消息 int main int argc char argv PGconn psql PGresult res int flag 0 openl
  • 通过 syslog 发送 log4j2 堆栈跟踪

    我正在尝试将堆栈跟踪记录到 Logstash 中 日志堆栈是 ELK ElasticSearch Logstash Kibana 产生日志的应用程序是一个Java应用程序 使用slf4j作为日志记录接口 以及log4j2作为日志记录的实现
  • Log4j2 SyslogAppender 不工作

    我正在使用 Log4j 版本 2 1 最新的稳定版本 并尝试使用 Syslog 附加程序来记录到 syslog 服务器 我正在使用他们官方网站上给出的配置 http logging apache org log4j 2 x manual a
  • 如何使 log4j syslog Appender 在一行中写入堆栈跟踪?

    我正在使用 log4j syslog 附加程序 并注意到当发生异常时 附加程序将堆栈跟踪中的每个条目写入新行 有没有一种方法可以对其进行配置 以便整个堆栈跟踪将作为一行而不是多行 我正在使用以下 log4j2 配置 该配置可以很好地发送到
  • Log4j2 Syslog Appender(TCP 协议)在多行中发送异常堆栈跟踪并显示错误的日志级别

    我正在使用 log4j2 和 syslog 附加程序 我使用 TCP 作为协议和 Kiwi 系统日志服务器 发送错误消息时 异常堆栈跟踪通过 TCP 分多行发送 每一行位于一个数据包中 堆栈跟踪的第一行显示 Kiwi syslog 服务器中
  • PHPUnit 接收系统日志消息吗?

    我正在使用打开日志的方法测试记录器类 如下所示 openlog this gt identifier this gt option this gt facility syslog level message closelog The fac
  • Python 日志记录:禁用输出到标准输出

    我试图让程序仅使用 SysLogHandler 实例进行日志记录 而不使用其他处理程序 我希望它不会记录到任何文件或标准输出 self logger logging getLogger self name syslog handler lo
  • 带有 upstart 和 syslog 的 Ubuntu docker 容器

    四处搜寻后 我仍然很困惑你是否可以拥有码头集装箱运行 Ubuntu 并运行初始化系统 暴发户 and syslog 或不 我知道 docker 容器是用于运行单个进程而不是完整的操作系统 但我的用例是在各种 Linux 发行版上测试守护进程
  • Syslog 真的有 1KB 消息限制吗?

    Syslog 似乎有 1KB 消息限制 这是硬编码到 Syslog 协议中的 还是可以为每个服务器设置的参数 我希望我读到的文章已经过时 所以如果您有任何信息 请分享 这是正确的 正如在系统日志协议 RFC https www rfc ed
  • docker-compose 日志记录不适用于 syslog 选项

    我有以下 docker compose 配置 version 3 services worker image image logging driver syslog options syslog address udp XXX papert
  • 查找系统日志最大消息长度

    大多数 Unix 程序员都会习惯由syslog h 并且许多实现 例如 glibc 对发送给它的 syslog 消息的大小没有真正的限制 但通常对侦听的应用程序有限制 dev log 我想知道是否有人知道如何找到系统日志的最大消息大小 或者
  • EDITLogBack Syslog 不工作 java

    我写了一个简单的项目来在 Ubuntu 中运行日志 方法如下example https examples javacodegeeks com enterprise java logback logback syslog example 应用

随机推荐

  • 【Quick-Cocos2d-x笔记】【一】Mac环境及相关配置

    本来是老老实实的想 xff0c 一心一意的先把C 43 43 学好 xff0c 在觉得自己C 43 43 水平还是菜鸟级的时候不要去动其他的东西 但自上次面试回来时候 xff0c 觉得这样不行啊 xff0c 虽然说现在从事的是C 43 43
  • matlab练习程序(粒子群优化PSO)

    算法没有和图像处理直接相关 xff0c 不过对于图像分类中的模式识别相关算法 xff0c 也许会用到这个优化算法 算法步骤 xff1a 1 首先确定粒子个数与迭代次数 2 对每个粒子随机初始化位置与速度 3 采用如下公式更新每个粒子的位置与
  • 您需要来自administrators的权限才能对此文件进行更改

    今天我重装了系统 xff0c 以前D盘里的一个文件夹想删除 xff0c 可以一直没法删除 xff0c 原先它提示 您需要来自 S 1 5 21 602162358 1284227242 682003330 500 的权限才能对此文件夹 xf
  • ***JAVA多线程的应用场景和应用目的举例

    多线程使用的主要目的在于 xff1a 1 吞吐量 xff1a 你做WEB xff0c 容器帮你做了多线程 xff0c 但是他只能帮你做请求层面的 简单的说 xff0c 可能就是一个请求一个线程 或多个请求一个线程 如果是单线程 xff0c
  • Kafka遇到30042ms has passed since batch creation plus linger time at org.apache.kafka.clients.producer...

    问题描述 xff1a 运行生产者线程的时候显示如下错误信息 xff1a Expiring 1 record s for XXX 0 30042 ms has passed since batch creation plus linger t
  • tcpdump -w 和 -r 的使用

    tcpdump的说明文档是这样的 xff1a w 将原始的信息包写入 形式如 tcpdump w tmp result txt 我今天试了一下 xff0c 发现其写成的文件如果用cat vim来查看的话 xff0c 都显示为乱码 经过man
  • 如何用Go访问深层嵌套的JSON数据?

    原文来自https hashnode com post how 大多数情况下 xff0c 开发人员需要使用来自其他服务的JSON数据并对其进行查询 查询JSON文档非常耗时 在过去的几天里 xff0c 我正在为Golang编写一个包 xff
  • Identity Card

    Identity Card Time Limit 2000 1000 MS Java Others Memory Limit 32768 32768 K Java Others Total Submission s 995 Accepted
  • 华为S5700交换机开启WEB配置

    近来很多朋友问关于S5700开启WEB不成功的问题 xff0c 现整理出具体步骤和命令 提示 xff1a 华为交换机配置时 xff0c 输入命令前几个字母 xff0c 按TAB可以自动补全命令 xff0c 比如在系统视图下输入sh按下TAB
  • 托管堆上对象的大小(Size)和Layout

    前几天 xff0c 我介绍了托管环境下struct实例的Layout和Size xff0c 其中介绍了StructLayoutAttribute特性 xff0c 其实StructLayoutAttribute特性不只可以用在struct上
  • 网上十大黑客软件大曝光

    网上十大黑客软件大曝光 Internet网上的黑客网站多如牛毛 xff0c 黑客软件也越来越多 越来越黑 笔者现将这些黑客软件分门别类地曝一曝光 xff0c 并提出相应的解决方案 xff0c 以防患于未然 一 古老的WinNuke 平台 x
  • C# DataSet和DataTable详解[转]

    1 创建DataSet对象 xff1a DataSet ds 61 new DataSet 34 DataSetName 34 2 查看调用SqlDataAdapter Fill创建的结构 da Fill ds 34 Orders 34 D
  • 【Python】爬取网站图片

    import requests import bs4 import urllib request import urllib import os hdr 61 39 User Agent 39 39 Mozilla 5 0 X11 Linu
  • 纯C++实现的HTTP请求(POST/GET)

    纯C 43 43 实现的HTTP请求 xff08 POST GET xff09 xff0c 支持windows和linux xff0c 进行简单的封装 xff0c 方便调用 实现如下 xff1a include 34 HttpConnect
  • python subprocess执行shell命令

    2019独角兽企业重金招聘Python工程师标准 gt gt gt subprocess的目的就是启动一个新的进程并且与之通信 subprocess模块中只定义了一个类 Popen 可以使用Popen来创建进程 xff0c 并与进程进行复杂
  • HDTV片源

    微软的 点击进入 苹果 quicktime下载 点击进入 国内一个网站 不过收费 电击进入 还有思路 转载于 https blog 51cto com wangjian 1420
  • Onvif鉴权实现方式

    Onvif鉴权实现方式 Digest 61 B64ENCODE SHA1 B64DECODE Nonce 43 Date 43 Password gsoap中digest生成代码 xff1a int soap wsse add Userna
  • 一文搞定Java并发编程面试考点

    2019独角兽企业重金招聘Python工程师标准 gt gt gt 1 在java中守护线程和本地线程区别 xff1f java中的线程分为两种 xff1a 守护线程 xff08 Daemon xff09 和用户线程 xff08 User
  • 数据结构c语言版创建链表实验报告,C语言数据结构-创建链表的四种方法

    结点类型 xff1a typedef int datatype typedef struct NODE datatype data struct NODE next Node LinkList 1 不带头结点的头插入法创建链表 每创建一个结
  • syslog-ng

    syslog ng配置 March 13th 2012 绚丽也尘埃 Leave a comment Go to comments syslog ng的配置非常简单直观 xff0c 于是乎配置好看看怎么用它实时收集日志 有两台服务器 xff0