syslog-ng.conf 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. @version: 3.19
  2. @include "scl.conf"
  3. # Syslog-ng configuration file, compatible with default Debian syslogd
  4. # installation.
  5. # First, set some global options.
  6. options { chain_hostnames(off); flush_lines(0); use_dns(no); dns-cache(no); use_fqdn(no);
  7. owner("root"); group("adm"); perm(0640); stats_freq(0);
  8. bad_hostname("^gconfd$");
  9. };
  10. ########################
  11. # Sources
  12. ########################
  13. # This is the default behavior of sysklogd package
  14. # Logs may come from unix stream, but not from another machine.
  15. #
  16. source s_src {
  17. unix-dgram("/dev/log");
  18. internal();
  19. };
  20. # If you wish to get logs from remote machine you should uncomment
  21. # this and comment the above source line.
  22. #
  23. #source s_net { tcp(ip(127.0.0.1) port(1000)); };
  24. ########################
  25. # Destinations
  26. ########################
  27. # First some standard logfile
  28. #
  29. destination d_auth { file("/var/log/auth.log"); };
  30. destination d_cron { file("/var/log/cron.log"); };
  31. destination d_daemon { file("/var/log/daemon.log"); };
  32. destination d_kern { file("/var/log/kern.log"); };
  33. destination d_lpr { file("/var/log/lpr.log"); };
  34. destination d_mail { file("/var/log/mail.log"); };
  35. destination d_syslog { file("/var/log/syslog"); };
  36. destination d_user { file("/var/log/user.log"); };
  37. destination d_uucp { file("/var/log/uucp.log"); };
  38. # This files are the log come from the mail subsystem.
  39. #
  40. destination d_mailinfo { file("/var/log/mail.info"); };
  41. destination d_mailwarn { file("/var/log/mail.warn"); };
  42. destination d_mailerr { file("/var/log/mail.err"); };
  43. # Logging for INN news system
  44. #
  45. destination d_newscrit { file("/var/log/news/news.crit"); };
  46. destination d_newserr { file("/var/log/news/news.err"); };
  47. destination d_newsnotice { file("/var/log/news/news.notice"); };
  48. # Some 'catch-all' logfiles.
  49. #
  50. destination d_debug { file("/var/log/debug"); };
  51. destination d_error { file("/var/log/error"); };
  52. destination d_messages { file("/var/log/messages"); };
  53. # The named pipe /dev/xconsole is for the nsole' utility. To use it,
  54. # you must invoke nsole' with the -file' option:
  55. #
  56. # $ xconsole -file /dev/xconsole [...]
  57. #
  58. destination d_xconsole { pipe("/dev/xconsole"); };
  59. # Send the messages to an other host
  60. #
  61. #destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); };
  62. # Debian only
  63. destination d_ppp { file("/var/log/ppp.log"); };
  64. # stdout for docker
  65. destination d_stdout { ##SYSLOG_OUTPUT_MODE_DEV_STDOUT##("/dev/stdout"); };
  66. ########################
  67. # Filters
  68. ########################
  69. # Here's come the filter options. With this rules, we can set which
  70. # message go where.
  71. filter f_dbg { level(debug); };
  72. filter f_info { level(info); };
  73. filter f_notice { level(notice); };
  74. filter f_warn { level(warn); };
  75. filter f_err { level(err); };
  76. filter f_crit { level(crit .. emerg); };
  77. filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
  78. filter f_error { level(err .. emerg) ; };
  79. filter f_messages { level(info,notice,warn) and
  80. not facility(auth,authpriv,cron,daemon,mail,news); };
  81. filter f_auth { facility(auth, authpriv) and not filter(f_debug); };
  82. filter f_cron { facility(cron) and not filter(f_debug); };
  83. filter f_daemon { facility(daemon) and not filter(f_debug); };
  84. filter f_kern { facility(kern) and not filter(f_debug); };
  85. filter f_lpr { facility(lpr) and not filter(f_debug); };
  86. filter f_local { facility(local0, local1, local3, local4, local5,
  87. local6, local7) and not filter(f_debug); };
  88. filter f_mail { facility(mail) and not filter(f_debug); };
  89. filter f_news { facility(news) and not filter(f_debug); };
  90. filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); };
  91. filter f_user { facility(user) and not filter(f_debug); };
  92. filter f_uucp { facility(uucp) and not filter(f_debug); };
  93. filter f_cnews { level(notice, err, crit) and facility(news); };
  94. filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); };
  95. filter f_ppp { facility(local2) and not filter(f_debug); };
  96. filter f_console { level(warn .. emerg); };
  97. ########################
  98. # Log paths
  99. ########################
  100. log { source(s_src); filter(f_auth); destination(d_auth); };
  101. log { source(s_src); filter(f_cron); destination(d_cron); };
  102. log { source(s_src); filter(f_daemon); destination(d_daemon); };
  103. log { source(s_src); filter(f_kern); destination(d_kern); };
  104. log { source(s_src); filter(f_lpr); destination(d_lpr); };
  105. log { source(s_src); filter(f_syslog3); destination(d_syslog); destination(d_stdout); };
  106. log { source(s_src); filter(f_user); destination(d_user); };
  107. log { source(s_src); filter(f_uucp); destination(d_uucp); };
  108. log { source(s_src); filter(f_mail); destination(d_mail); };
  109. #log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); };
  110. #log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); };
  111. #log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); };
  112. log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); };
  113. log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); };
  114. log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); };
  115. #log { source(s_src); filter(f_cnews); destination(d_console_all); };
  116. #log { source(s_src); filter(f_cother); destination(d_console_all); };
  117. #log { source(s_src); filter(f_ppp); destination(d_ppp); };
  118. log { source(s_src); filter(f_debug); destination(d_debug); };
  119. log { source(s_src); filter(f_error); destination(d_error); };
  120. log { source(s_src); filter(f_messages); destination(d_messages); };
  121. # All messages send to a remote site
  122. #
  123. #log { source(s_src); destination(d_net); };
  124. ###
  125. # Include all config files in /etc/syslog-ng/conf.d/
  126. ###
  127. @include "/etc/syslog-ng/conf.d/*.conf"