If you just call logging.getLogger() in a middleware, nothing works (in Essex). However, this is incorrect: diff --git a/keystone/middleware/s3_token.py b/keystone/middleware/s3_token.py index 0c5b103..f72a9ca 100644 --- a/keystone/middleware/s3_token.py +++ b/keystone/middleware/s3_token.py @@ -36,6 +36,8 @@ """Starting point for routing S3 requests.""" +import logging +from logging.handlers import SysLogHandler import httplib import json @@ -46,6 +48,12 @@ from swift.common import utils as swift_utils PROTOCOL_NAME = "S3 Token Authentication" +logger = logging.getLogger(__name__) +logger.propagate = False +logger.addHandler(SysLogHandler(address='/dev/log', + facility=SysLogHandler.LOG_LOCAL0)) +logger.setLevel(logging.INFO) + class S3Token(object): """Auth Middleware that handles S3 authenticating client calls.""" @@ -145,6 +153,9 @@ def filter_factory(global_conf, **local_conf): conf = global_conf.copy() conf.update(local_conf) + # P3 + logger.info("s3 factory") + def auth_filter(app): return S3Token(app, conf) return auth_filter Here's the commentary: anotherjesse2: http://people.redhat.com/zaitcev/tmp/x.diff zaitcev: all that code should already have been run in setup_logging() before the pipeline even initalizes the middleware... anotherjesse: can you verify that setup_logging() has been called? jaypipes: if so, then what jesse has in that paste is fine, right? jaypipes: RE logging bcwaldon: should be... depends on the code that comes before the middleware initialization... setup_logging() needs to be called before load_paste_app(). jaypipes: but the middleware is getting a different logger than the setup would do jaypipes: since the setup would be for glance or nova, but he's using a keystone logger bcwaldon: in setup_logging(), try putting logger.propogate = True