]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add logging
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Mar 2020 10:56:33 +0000 (10:56 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Mar 2020 10:56:33 +0000 (10:56 +0000)
src/libserver/fuzzy_backend/fuzzy_backend_redis.c

index 08f228f3518bf3f6f2d2f0239dc9b7ac54541fb0..6a51831a71fa4823ee9395d02e7a46c182a284a2 100644 (file)
@@ -113,6 +113,17 @@ rspamd_redis_get_servers (struct rspamd_fuzzy_backend_redis *ctx,
        if (lua_type (L, -1) == LUA_TUSERDATA) {
                res = *((struct upstream_list **) lua_touserdata (L, -1));
        }
+       else {
+               struct lua_logger_trace tr;
+               gchar outbuf[8192];
+
+               memset (&tr, 0, sizeof (tr));
+               lua_logger_out_type (L, -2, outbuf, sizeof (outbuf) - 1, &tr,
+                               LUA_ESCAPE_UNPRINTABLE);
+
+               msg_err ("cannot get %s upstreams for Redis fuzzy storage %s; table content: %s",
+                               what, ctx->id, outbuf);
+       }
 
        lua_settop (L, 0);