[syslog-ng] Problem in source file driver

広瀬 真作 s.hirose at itboost.co.jp
Mon Jun 30 04:33:01 CEST 2008


Hello all,

I use syslog-ng 2.0.9.
I am troubled in how to use the source file driver.
The trouble is that a log message is output in duplicate after syslog-ng restart.

I made following syslog-ng.conf.
------------------------------------------------------------
options { 
  long_hostnames(off);
  sync(0);
  stats(0);
  time_reopen(10);
  dir_perm(0755);
  perm(0644);
};

source s_test1 {
  internal();
  file("/tmp/test_app_log" follow_freq(1) flags(no-parse) keep_timestamp(no));
};

destination d_test1 { file("/var/log/test.log"); };

log { source(s_test1); destination(d_test1); }; 
------------------------------------------------------------

Next I tested syslog-ng action with following operation.
------------------------------------------------------------
# echo "test message `date`" >> /tmp/test_app_log
# cat /var/log/test.log
Jun 30 10:58:46 testserv2 syslog-ng[17216]: Configuration reload request received, reloading configuration; 
Jun 30 10:58:46 testserv2 syslog-ng[17216]: Configuration reload request received, reloading configuration; 
Jun 30 10:58:46 testserv2 syslog-ng[17216]: Configuration reload request received, reloading configuration; 
Jun 30 10:58:46 testserv2 syslog-ng[17216]: Configuration reload request received, reloading configuration; 
Jun 30 10:58:54 testserv2 test message Mon Jun 30 10:58:53 JST 2008
# /etc/init.d/syslog-ng restart
Stopping syslog-ng:                                        [  OK  ]
Starting syslog-ng:                                        [  OK  ]
# cat /var/log/test.log
Jun 30 10:58:46 testserv2 syslog-ng[17216]: Configuration reload request received, reloading configuration; 
Jun 30 10:58:46 testserv2 syslog-ng[17216]: Configuration reload request received, reloading configuration; 
Jun 30 10:58:46 testserv2 syslog-ng[17216]: Configuration reload request received, reloading configuration; 
Jun 30 10:58:46 testserv2 syslog-ng[17216]: Configuration reload request received, reloading configuration; 
Jun 30 10:58:54 testserv2 test message Mon Jun 30 10:58:53 JST 2008
Jun 30 10:59:05 testserv2 syslog-ng[17216]: Termination requested via signal, terminating; 
Jun 30 10:59:05 testserv2 syslog-ng[17216]: syslog-ng shutting down; version='2.0.9'
Jun 30 10:59:05 testserv2 syslog-ng[17292]: syslog-ng starting up; version='2.0.9'
Jun 30 10:59:05 testserv2 test message Mon Jun 30 10:58:53 JST 2008
------------------------------------------------------------

The message "testserv2 test message Mon Jun 30 10:58:53 JST 2008" was output in duplicate after syslog-ng retart.
I hope the message is not output in duplicate after syslog-ng restart.
Is my hope readily achievable?

Please advise me.



More information about the syslog-ng mailing list