aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-04 11:56:54 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-04 11:56:54 +0000
commit29ab9db4f0c9619877773d02278a7a9296803893 (patch)
treea486129d76c1116cad08ce573f846fa05b824347
parentc6db379233b0f15ba68f93286aea194b7ca5d4b6 (diff)
downloadrspamd-29ab9db4f0c9619877773d02278a7a9296803893.tar.gz
rspamd-29ab9db4f0c9619877773d02278a7a9296803893.zip
[Minor] Slightly improve CH logging
-rw-r--r--src/plugins/lua/clickhouse.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index 93165d842..cd9d992d8 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -384,7 +384,7 @@ local function clickhouse_send_data(task, ev_base, why)
local function gen_success_cb(what, how_many)
return function (_, _)
- rspamd_logger.infox(log_object, "sent %s rows of %s to clickhouse server %s; started as %s",
+ rspamd_logger.messagex(log_object, "sent %s rows of %s to clickhouse server %s; started as %s",
how_many, what, ip_addr, why)
upstream:ok()
end
@@ -932,19 +932,21 @@ local function clickhouse_maybe_send_data_periodic(cfg, ev_base, now)
if settings.limits.max_rows > 0 then
if nrows > settings.max_rows then
need_collect = true
- reason = 'limit of rows has been reached'
+ reason = string.format('limit of rows has been reached: %d', nrows)
end
end
if settings.limits.max_interval > 0 then
if now - last_collection > settings.limits.max_interval then
need_collect = true
- reason = 'limit of time since last collection has been reached'
+ reason = string.format('limit of time since last collection has been reached: %d seconds passed',
+ (now - last_collection) - settings.limits.max_interval)
end
end
if settings.limits.max_memory > 0 then
if used_memory >= settings.limits.max_memory then
need_collect = true
- reason = 'limit of memory has been reached'
+ reason = string.format('limit of memory has been reached: %d bytes used',
+ used_memory)
end
end