summaryrefslogtreecommitdiff
path: root/swift/common/middleware/catch_errors.py
diff options
context:
space:
mode:
Diffstat (limited to 'swift/common/middleware/catch_errors.py')
-rw-r--r--swift/common/middleware/catch_errors.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/swift/common/middleware/catch_errors.py b/swift/common/middleware/catch_errors.py
index e2287fdbe..10d861419 100644
--- a/swift/common/middleware/catch_errors.py
+++ b/swift/common/middleware/catch_errors.py
@@ -26,7 +26,11 @@ class CatchErrorMiddleware(object):
def __init__(self, app, conf):
self.app = app
- self.logger = get_logger(conf)
+ # if the application already has a logger we should use that one
+ self.logger = getattr(app, 'logger', None)
+ if not self.logger:
+ # and only call get_logger if we have to
+ self.logger = get_logger(conf)
def __call__(self, env, start_response):
try: