changeset 6046:f7175dbb081e

abuse logging: add CHANGES entry, add example logging configuration, revert wikiserverlogging.conf reverted wikiserverlogging.conf to previous state (it is mainly used for debugging / developers, not so much in scenarios where we want abuse logging handled in special ways). see wiki/config/logging/abuse for an abuse logging example.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 06 Jun 2014 14:08:21 +0200
parents f029e42ecdec
children a9bfc8e99775
files docs/CHANGES wiki/config/logging/abuse wikiserverlogging.conf
diffstat 3 files changed, 51 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/docs/CHANGES	Fri Jun 06 13:33:16 2014 +0200
+++ b/docs/CHANGES	Fri Jun 06 14:08:21 2014 +0200
@@ -43,6 +43,9 @@
     TIME is in seconds, the slowness indicator is "." for sub-second requests
     or N times "!" for requests taking N seconds (so you easily can grep for
     slow stuff).
+  * add "abuse" logging. currently this is only used by authentication system
+    (and there only for "moin" and "given" auth). abuse logging is configured
+    via the logging configuration, see example: wiki/config/logging/abuse
   * backlinks performance tuning: the pagename in the theme has historically
     been used to trigger a "linkto:ThisPage" search. While this is a nice
     feature for human users of the wiki (esp. on category pages), it has one
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiki/config/logging/abuse	Fri Jun 06 14:08:21 2014 +0200
@@ -0,0 +1,45 @@
+[DEFAULT]
+# Logfile to create.
+# Make sure the running moin process has create/write rights there.
+logfile=/tmp/abuse.log
+
+[loggers]
+keys=root,moin_abuse
+
+[logger_root]
+level=INFO
+handlers=stderr
+
+[logger_moin_abuse]
+level=INFO
+handlers=abuse
+qualname=MoinMoin.util.abuse
+propagate=0
+
+[handlers]
+keys=stderr,abuse
+
+[handler_stderr]
+class=StreamHandler
+formatter=default
+level=DEBUG
+args=(sys.stderr, )
+
+[handler_abuse]
+class=FileHandler
+formatter=abuse
+level=DEBUG
+args=('%(logfile)s', 'at')
+
+[formatters]
+keys=default,abuse
+
+[formatter_default]
+format=%(asctime)s %(levelname)s %(name)s:%(lineno)d %(message)s
+datefmt=
+class=logging.Formatter
+
+[formatter_abuse]
+format=%(asctime)s %(levelname)s %(message)s
+datefmt=
+class=logging.Formatter
--- a/wikiserverlogging.conf	Fri Jun 06 13:33:16 2014 +0200
+++ b/wikiserverlogging.conf	Fri Jun 06 14:08:21 2014 +0200
@@ -6,7 +6,7 @@
 logfile=moin.log
 
 [loggers]
-keys=root,moin_debug,moin_abuse
+keys=root,moin_debug
 
 [logger_root]
 level=INFO
@@ -19,16 +19,9 @@
 qualname=MoinMoin.auth
 propagate=0
 
-[logger_moin_abuse]
-# adapt the next lines to your abuse logging needs:
-level=INFO
-handlers=abuse
-qualname=MoinMoin.util.abuse
-propagate=0
-
 [handlers]
 #keys=logfile,stderr
-keys=stderr,abuse
+keys=stderr
 
 [handler_logfile]
 class=FileHandler
@@ -42,22 +35,11 @@
 level=DEBUG
 args=(sys.stderr, )
 
-[handler_abuse]
-class=StreamHandler
-formatter=abuse
-level=DEBUG
-args=(sys.stderr, )
-
 [formatters]
-keys=default,abuse
+keys=default
 
 [formatter_default]
 format=%(asctime)s %(levelname)s %(name)s:%(lineno)d %(message)s
 datefmt=
 class=logging.Formatter
 
-[formatter_abuse]
-format=%(asctime)s %(levelname)s %(message)s
-datefmt=
-class=logging.Formatter
-