yum install –y syslolg-ng

配置文件

/etc/syslog-ng/syslog-ng.conf

@version:3.2
options {
    flush_lines (0);
    time_reopen (10);
    log_fifo_size (1000);
    long_hostnames (off);
    use_dns (no);
    use_fqdn (no);
    create_dirs (no);
    keep_hostname (yes);
};
options { 
    long_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no);
          owner("root"); group("adm"); perm(0640); stats_freq(0);
          bad_hostname("^gconfd$");
};
source test{ 
    file("/data/logs/xcloud-ncs2/xcloud-cs.2016-11-24_0.error.log" follow_freq(1) program_override("xcloud-ncs2.error"));
    file("/data/logs/xcloud-ncs2/xcloud-cs.2016-11-24_0.info.log" follow_freq(1) program_override("xcloud-ncs2.info"));
};
destination test { 
    syslog("192.168.126.15" transport("tcp") port(5555) template("$MESSAGE\n"));
};
log { 
    source(test); 
        destination(test); 
};
Copyright © opschina.org 2017 with zzlyzq@gmail.com all right reserved,powered by Gitbook该文件修订时间: 2017-07-11 11:32:48

results matching ""

    No results matching ""