Skip to content

Commit

Permalink
Syslog: accept include directive
Browse files Browse the repository at this point in the history
  • Loading branch information
lutter authored and raphink committed Oct 16, 2018
1 parent 93e6ba2 commit c608a4b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
1.12.0 - ????-??-??
- Lens changes/additions
* Multipath: accept values enclosed in quotes (Issue #583)
* Syslog: accept 'include' directive (Issue #486)

1.11.0 - 2018-08-24
- General changes/additions
Expand Down
7 changes: 5 additions & 2 deletions lenses/syslog.aug
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ module Syslog =
(* View: entries
entries are either comments/empty lines or entries
*)
let entries = (empty | comment | entry)*
let entries = (empty | comment | entry )*

(* Group: Program matching *)

Expand Down Expand Up @@ -253,10 +253,13 @@ module Syslog =

(* Group: Top of the tree *)

let include =
[ key "include" . sep_tab . store file_r . eol ]

(* View: lns
generic entries then programs or hostnames matching blocs
*)
let lns = entries . ( program | hostname )*
let lns = entries . ( program | hostname | include )*

(* Variable: filter
all you need is /etc/syslog.conf
Expand Down
3 changes: 3 additions & 0 deletions lenses/tests/test_syslog.aug
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,6 @@ daemon.info /var/log/cvsupd.log
(* allow space before comments *)
test Syslog.lns get " \t# space comment\n" =
{ "#comment" = "space comment" }

test Syslog.lns get "include /etc/syslog.d\n" =
{ "include" = "/etc/syslog.d" }
38 changes: 38 additions & 0 deletions tests/root/etc/syslog.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# $FreeBSD$
#
# Spaces ARE valid field separators in this file. However,
# other *nix-like systems still insist on using tabs as field
# separators. If you are sharing this file between systems, you
# may want to use only tabs as field separators here.
# Consult the syslog.conf(5) manpage.
*.err;kern.warning;auth.notice;mail.crit /dev/console
*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
security.* /var/log/security
auth.info;authpriv.info /var/log/auth.log
mail.info /var/log/maillog
lpr.info /var/log/lpd-errs
ftp.info /var/log/xferlog
cron.* /var/log/cron
!-devd
*.=debug /var/log/debug.log
*.emerg *
# uncomment this to log all writes to /dev/console to /var/log/console.log
# touch /var/log/console.log and chmod it to mode 600 before it will work
#console.info /var/log/console.log
# uncomment this to enable logging of all log messages to /var/log/all.log
# touch /var/log/all.log and chmod it to mode 600 before it will work
#*.* /var/log/all.log
# uncomment this to enable logging to a remote loghost named loghost
#*.* @loghost
# uncomment these if you're running inn
# news.crit /var/log/news/news.crit
# news.err /var/log/news/news.err
# news.notice /var/log/news/news.notice
# Uncomment this if you wish to see messages produced by devd
# !devd
# *.>=notice /var/log/devd.log
!ppp
*.* /var/log/ppp.log
!*
include /etc/syslog.d
include /usr/local/etc/syslog.d

0 comments on commit c608a4b

Please sign in to comment.