deleting log files - syslog-ng
Hello, is it possible that I have to restart syslog-ng, when deleting a log file? I log from different hosts to different files using $HOST in the config-file. If I delete one file of them it is not created until restarting syslog-ng. Is it possible to change this behaviour. Ciao, Thomas -- Thomas Kähn WESTEND GmbH - Aachen und Dueren Tel 0241/701333-0 tk@westend.com Internet & Security for Professionals Fax 0241/911879 WESTEND ist CISCO Systems Partner - Premium Certified
Perhaps you're trying to empty a log file? If so, one might consider using: cp /some/where/file.log /some/where/old/file.log.old cp /dev/null /some/where/file.log This way, file still exists and file descriptos are not closed. However, this is not atomic, one might lose logged lines before file is truncated. -MNi
-----Original Message----- From: syslog-ng-admin@lists.balabit.hu [mailto:syslog-ng-admin@lists.balabit.hu]On Behalf Of Thomas Kaehn Sent: Friday, October 26, 2001 12:12 PM To: syslog-ng@lists.balabit.hu Subject: [syslog-ng]deleting log files - syslog-ng
Hello,
is it possible that I have to restart syslog-ng, when deleting a log file? I log from different hosts to different files using $HOST in the config-file. If I delete one file of them it is not created until restarting syslog-ng. Is it possible to change this behaviour.
Ciao, Thomas -- Thomas Kähn WESTEND GmbH - Aachen und Dueren Tel 0241/701333-0 tk@westend.com Internet & Security for Professionals Fax 0241/911879 WESTEND ist CISCO Systems Partner - Premium Certified
_______________________________________________ syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng
On Fri, Oct 26, 2001 at 11:11:56AM +0200, Thomas Kaehn wrote:
Hello,
is it possible that I have to restart syslog-ng, when deleting a log file? I log from different hosts to different files using $HOST in the config-file. If I delete one file of them it is not created until restarting syslog-ng. Is it possible to change this behaviour.
open files are reaped after a specific time interval if no new messages are written to it. So if your time_reap() is 60 seconds, and a new message pops up within this 60 seconds, then the file is not closed. to force reopening the file you might try sending a -HUP signal to syslog-ng, it'll drop TCP connections (can be changed with the keep-alive() option), but not local AF_UNIX connections, and also reopens all files. -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
participants (3)
-
Balazs Scheidler
-
Mikko Niskanen
-
Thomas Kaehn