diff options
| author | Roland Hedberg <roland.hedberg@adm.umu.se> | 2012-06-28 07:14:17 +0200 |
|---|---|---|
| committer | Roland Hedberg <roland.hedberg@adm.umu.se> | 2012-06-28 07:14:17 +0200 |
| commit | ca66fa8c9c5fc978eee6c17dabd0e0dbdcc99418 (patch) | |
| tree | 5d1ae1e420e2dd154d1970c36498d1a70b9ade69 /example/sp | |
| parent | e537025ea30a347e155e8247470831f50dcc0c45 (diff) | |
| download | pysaml2-ca66fa8c9c5fc978eee6c17dabd0e0dbdcc99418.tar.gz | |
Working logging
Diffstat (limited to 'example/sp')
| -rwxr-xr-x | example/sp/sp.py | 8 | ||||
| -rw-r--r-- | example/sp/sp_conf.py | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/example/sp/sp.py b/example/sp/sp.py index a6261882..95bc523d 100755 --- a/example/sp/sp.py +++ b/example/sp/sp.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +import logging import re from cgi import parse_qs @@ -157,8 +158,9 @@ def application(environ, start_response): path = environ.get('PATH_INFO', '').lstrip('/') logger = environ.get('repoze.who.logger') - if logger: - logger.info( "<application> PATH: %s" % path) + logger.info("<application> PATH: %s" % path) + logger.info("logger name: %s" % logger.name) + logger.info(logging.Logger.manager.loggerDict) for regex, callback in urls: if user: match = re.search(regex, path) @@ -177,7 +179,7 @@ def application(environ, start_response): from repoze.who.config import make_middleware_with_config app_with_auth = make_middleware_with_config(application, {"here":"."}, - './who.ini', log_file="sp.log") + './who.ini', log_file="repoze_who.log") # ---------------------------------------------------------------------------- PORT = 8087 diff --git a/example/sp/sp_conf.py b/example/sp/sp_conf.py index 69cf5559..faebdf87 100644 --- a/example/sp/sp_conf.py +++ b/example/sp/sp_conf.py @@ -41,5 +41,13 @@ CONFIG = { }, ], #"xmlsec_binary":"/usr/local/bin/xmlsec1", - "name_form": NAME_FORMAT_URI + "name_form": NAME_FORMAT_URI, + "logger": { + "rotating": { + "filename": "sp.log", + "maxBytes": 100000, + "backupCount": 5, + }, + "loglevel": "debug", + } } |
