summaryrefslogtreecommitdiff
path: root/net-firewall/ufw/files/syslog-ng
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-firewall/ufw/files/syslog-ng
reinit the tree, so we can have metadata
Diffstat (limited to 'net-firewall/ufw/files/syslog-ng')
-rw-r--r--net-firewall/ufw/files/syslog-ng/syslog-ng.example13
-rw-r--r--net-firewall/ufw/files/syslog-ng/ufw.logrotate12
2 files changed, 25 insertions, 0 deletions
diff --git a/net-firewall/ufw/files/syslog-ng/syslog-ng.example b/net-firewall/ufw/files/syslog-ng/syslog-ng.example
new file mode 100644
index 000000000000..41f7ce39cef7
--- /dev/null
+++ b/net-firewall/ufw/files/syslog-ng/syslog-ng.example
@@ -0,0 +1,13 @@
+# This is an example rule for app-admin/syslog-ng to separate ufw logs
+# from /var/log/messages.
+# Place those lines before "log" entries in /etc/syslog-ng/syslog-ng.conf.
+
+filter f_ufw { match("\\[UFW " value("MESSAGE")); };
+destination ufwfile { file("/var/log/ufw.log"); };
+log {
+ source(src);
+ filter(f_ufw);
+ destination(ufwfile);
+ destination(console_all);
+ flags(final);
+};
diff --git a/net-firewall/ufw/files/syslog-ng/ufw.logrotate b/net-firewall/ufw/files/syslog-ng/ufw.logrotate
new file mode 100644
index 000000000000..5080aa1bfa38
--- /dev/null
+++ b/net-firewall/ufw/files/syslog-ng/ufw.logrotate
@@ -0,0 +1,12 @@
+# logrotate snippet for ufw
+# requires app-admin/syslog-ng
+# copy the file into /etc/logrotate.d
+/var/log/ufw.log {
+ missingok
+ rotate 5
+ notifempty
+ sharedscripts
+ postrotate
+ /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
+ endscript
+}