How should my program() destination handle incoming logs?


When using the ''program()'' destination driver, the script processing the messages exits after processing the first message.


Read log messages from stdin. Instead of fetching a single line and exiting, keep reading the input. For example in Perl this can be accomplished as follows:

  1. !/usr/bin/perl while (<>) {
  2. process messages }

Additional information

Please note, that syslog-ng automatically restarts applications started by ''program()'', which can cause unnecessary load on the machine if happens too often.