commit d623ed2: [Minor] Fuzzy_backend_redis: Improve logging
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Mar 9 13:14:06 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-03-09 13:09:52 +0000
URL: https://github.com/rspamd/rspamd/commit/d623ed249bfd924bbf08df446f4542d7b30218ce (HEAD -> master)
[Minor] Fuzzy_backend_redis: Improve logging
---
src/libserver/fuzzy_backend/fuzzy_backend_redis.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
index e87ee29d9..32f03cfe2 100644
--- a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
+++ b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
@@ -486,7 +486,9 @@ rspamd_fuzzy_backend_check_shingles (struct rspamd_fuzzy_redis_session *session)
if (redisAsyncCommandArgv (session->ctx, rspamd_fuzzy_redis_shingles_callback,
session, session->nargs,
(const gchar **)session->argv, session->argv_lens) != REDIS_OK) {
- msg_err ("cannot execute redis command: %s", session->ctx->errstr);
+ msg_err ("cannot execute redis command on %s: %s",
+ rspamd_inet_address_to_string_pretty (rspamd_upstream_addr_cur (session->up)),
+ session->ctx->errstr);
if (session->callback.cb_check) {
memset (&rep, 0, sizeof (rep));
@@ -579,7 +581,9 @@ rspamd_fuzzy_redis_check_callback (redisAsyncContext *c, gpointer r,
}
if (c->errstr) {
- msg_err_redis_session ("error getting hashes: %s", c->errstr);
+ msg_err_redis_session ("error getting hashes on %s: %s",
+ rspamd_inet_address_to_string_pretty (rspamd_upstream_addr_cur (session->up)),
+ c->errstr);
}
rspamd_upstream_fail (session->up, FALSE, strerror (errno));
@@ -718,7 +722,9 @@ rspamd_fuzzy_redis_count_callback (redisAsyncContext *c, gpointer r,
}
if (c->errstr) {
- msg_err_redis_session ("error getting count: %s", c->errstr);
+ msg_err_redis_session ("error getting count on %s: %s",
+ rspamd_inet_address_to_string_pretty (rspamd_upstream_addr_cur (session->up)),
+ c->errstr);
}
rspamd_upstream_fail (session->up, FALSE, strerror (errno));
@@ -841,7 +847,9 @@ rspamd_fuzzy_redis_version_callback (redisAsyncContext *c, gpointer r,
}
if (c->errstr) {
- msg_err_redis_session ("error getting version: %s", c->errstr);
+ msg_err_redis_session ("error getting version on %s: %s",
+ rspamd_inet_address_to_string_pretty (rspamd_upstream_addr_cur (session->up)),
+ c->errstr);
}
rspamd_upstream_fail (session->up, FALSE, strerror (errno));
@@ -1331,7 +1339,9 @@ rspamd_fuzzy_redis_update_callback (redisAsyncContext *c, gpointer r,
}
if (c->errstr) {
- msg_err_redis_session ("error sending update to redis: %s", c->errstr);
+ msg_err_redis_session ("error sending update to redis %s: %s",
+ rspamd_inet_address_to_string_pretty (rspamd_upstream_addr_cur (session->up)),
+ c->errstr);
}
rspamd_upstream_fail (session->up, FALSE, strerror (errno));
More information about the Commits
mailing list