Search code examples
syslog-ng

syslog-ng sending message to console and file


I want to send syslog messages to console and file. For sending it to file I am using following configuration.

destination d_mycode { file("/var/log/app.log"); };
filter f_mycode { program(mycode); };
log { source(s_src); filter(f_mycode); destination(d_mycode); };

How can I send same message to console also? What changes do I need to make in configuration file?


Solution

  • just create a console destination and include it in your log path:

    destination d_usertty { usertty("root"); };
    log { source(s_src); filter(f_mycode); destination(d_mycode); destination (d_usertty); };