This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push:
new ebef545 backend: get_redis_logger: skip log entries bellow log_level
ebef545 is described below
commit ebef545062f886e146bf8d3327276a9fb3676e91
Author: Pavel Raiskup <praiskup(a)redhat.com>
AuthorDate: Sat Oct 12 14:18:39 2019 +0200
backend: get_redis_logger: skip log entries bellow log_level
The RedisLogHandler already reads and respects log_level option from
configuration (by default INFO), so we don't actually waste the space in
log files. But it is even useless to overwhelm redis server with
messages which are eventually not going to be printed to log file. So
from now, the "level" is respected also on log entry "sender" side
(and
I personally think that we could respect the level _only_ on sender
side, and let the RedisLogHandler dump everything is received, ... maybe
next PR?).
This is reaction for magically disappearing log entries upon Worker
failure (exceptions should be logged, but are not). I suppose that the
redis server isn't ready to process all the log entries, and it leads to
obscure system states.
Merges: #1065
---
backend/backend/helpers.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/backend/backend/helpers.py b/backend/backend/helpers.py
index b2e4e2e..6329443 100644
--- a/backend/backend/helpers.py
+++ b/backend/backend/helpers.py
@@ -425,7 +425,9 @@ class RedisPublishHandler(logging.Handler):
def get_redis_logger(opts, name, who):
logger = logging.getLogger(name)
- logger.setLevel(logging.DEBUG)
+ level = getattr(opts, 'log_level', 'debug')
+ level = getattr(logging, level.upper(), logging.DEBUG)
+ logger.setLevel(level)
if not logger.handlers:
rc = get_redis_connection(opts)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date