diff options
author | Yaron Yogev <yaronyogev@gmail.com> | 2017-08-02 16:57:13 +0300 |
---|---|---|
committer | Yaron Yogev <yaronyogev@gmail.com> | 2017-08-02 16:57:13 +0300 |
commit | f1aead51e5e71b06c8a54d709c8f67ef099e2215 (patch) | |
tree | 64714fa29d3f2560bbab7e43fdaad05aede6c3d7 /app | |
parent | ffdf764c73ea8d7e5dab94a073ac7b0f079fc19a (diff) |
fix setting environment name for Mongo logging
Change-Id: Iaa8509743ef924e6cbd2016a875dbf8f44815819
Signed-off-by: Yaron Yogev <yaronyogev@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/utils/logging/full_logger.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/utils/logging/full_logger.py b/app/utils/logging/full_logger.py index a88f00e..411eceb 100644 --- a/app/utils/logging/full_logger.py +++ b/app/utils/logging/full_logger.py @@ -35,13 +35,9 @@ class FullLogger(Logger): def set_env(self, env): super().set_env(env) - defined_handler = next( - filter( - lambda handler: handler.__class__ == MongoLoggingHandler.__class__, - self.log.handlers - ), None) - + defined_handler = [h for h in self.log.handlers + if isinstance(h, MongoLoggingHandler)] if defined_handler: - defined_handler.env = env + defined_handler[0].env = env else: self.add_handler(MongoLoggingHandler(env, self.level)) |