免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3639 | 回复: 2
打印 上一主题 下一主题

syslog-ng不自动发送日志 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-10-12 14:27 |只看该作者 |倒序浏览
CentOS 版本:CentOS release 5.6 (Final)
syslog-ng 版本: syslog-ng 2.1.4
从一台机发送日志到另一台机,刚启动时有发送日志过去,之后就很久没发了;而我每reload一下配置文件就会发送一次日志,不reload就不发。
对syslog-ng还不熟悉,不知什么原因,请高手帮忙看下什么原因!

论坛徽章:
0
2 [报告]
发表于 2011-10-12 14:41 |只看该作者
回复 1# railon


    看配置文件

论坛徽章:
0
3 [报告]
发表于 2011-10-12 15:33 |只看该作者
# syslog-ng configuration file.
#
# This should behave pretty much like the original syslog on RedHat. But
# it could be configured a lot smarter.
#
# See syslog-ng( and syslog-ng.conf(5) for more information.
#

options {
        sync (0);
        time_reopen (10);
        log_fifo_size (10);
        long_hostnames (off);
        use_dns (no);
        use_fqdn (no);
        create_dirs (no);
        keep_hostname (yes);
};

source s_sys {
        file ("/proc/kmsg" log_prefix("kernel: ");
        unix-stream ("/dev/log";
        internal();
        # udp(ip(0.0.0.0) port(514));
};

source s_msg { file ("/var/log/messages"; };
source s_nginx { file ("/var/log/nginx/proftpd-admin.access.log"; };

destination d_cons { file("/dev/console"; };
destination d_mesg { file("/var/log/messages"; };
destination d_auth { file("/var/log/secure"; };
destination d_mail { file("/var/log/maillog" sync(10)); };
destination d_spol { file("/var/log/spooler"; };
destination d_boot { file("/var/log/boot.log"; };
destination d_cron { file("/var/log/cron"; };
destination d_kern { file("/var/log/kern"); };
destination d_mlal { usertty("*"); };

destination d_msg { tcp("192.168.0.214" port(515)); };
destination d_nginx { udp("192.168.0.214" port(514)); };

filter f_kernel     { facility(kern); };
filter f_default    { level(info..emerg) and
                        not (facility(mail)
                        or facility(authpriv)
                        or facility(cron)); };
filter f_auth       { facility(authpriv); };
filter f_mail       { facility(mail); };
filter f_emergency  { level(emerg); };
filter f_news       { facility(uucp) or
                        (facility(news)
                        and level(crit..emerg)); };
filter f_boot   { facility(local7); };
filter f_cron   { facility(cron); };

#log { source(s_sys); filter(f_kernel); destination(d_cons); };
log { source(s_sys); filter(f_kernel); destination(d_kern); };
log { source(s_sys); filter(f_default); destination(d_mesg); };
log { source(s_sys); filter(f_auth); destination(d_auth); };
log { source(s_sys); filter(f_mail); destination(d_mail); };
log { source(s_sys); filter(f_emergency); destination(d_mlal); };
log { source(s_sys); filter(f_news); destination(d_spol); };
log { source(s_sys); filter(f_boot); destination(d_boot); };
log { source(s_sys); filter(f_cron); destination(d_cron); };

log { source(s_msg); destination(d_msg); };
log { source(s_nginx); destination(d_nginx); };

# vim:ft=syslog-ng:ai:si:ts=4:sw=4:et:
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP