Syslog-ng

From KeegansWiki
Revision as of 13:06, 8 February 2011 by Keegan (talk | contribs) (Created page with '<pre> #Default configuration file for syslog-ng. # # For a description of syslog-ng configuration file directives, please read # the syslog-ng Administrator's guide at: # # http…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

#Default configuration file for syslog-ng.
#
# For a description of syslog-ng configuration file directives, please read
# the syslog-ng Administrator's guide at:
#
# http://www.balabit.com/dl/html/syslog-ng-admin-guide_en.html/bk01-toc.html
#

options {
        create_dirs(yes);
        owner(root);       # owner of created files
        group(root);       # group of created files
        perm(0644);        # permissions of created files
        dir_perm(0755);    # permissions of created dirs

        long_hostnames(off);
        keep_hostname(yes);
        use_dns(yes);
};

######
# sources
source s_local {
# message generated by Syslog-NG
internal();
# standard Linux log source (this is the default place for the syslog()
# function to send logs to)
unix-stream("/dev/log");
# messages from the kernel
file("/proc/kmsg" program_override("kernel: "));

};

source remote
{
        internal();
        unix-stream("/dev/log");
        udp();
};


######
# destinations
destination d_messages { file("/var/log/messages"); };
#sorts all incoming traffic by hostname (if it is in dns, otherwise uses the originating IP), then by date. One file is created per day, per host.
destination messages { file("/syslog/$HOST/$R_YEAR/$R_MONTH/$R_YEAR-$R_MONTH-$R_DAY"); };

log {
source(s_local);
destination(d_messages);
};

log {
        source(remote);
        destination(messages);
};