]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Lua_scanners: Improve logging
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 18 Oct 2019 10:51:17 +0000 (11:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 18 Oct 2019 10:51:17 +0000 (11:51 +0100)
lualib/lua_scanners/clamav.lua
lualib/lua_scanners/dcc.lua
lualib/lua_scanners/fprot.lua
lualib/lua_scanners/kaspersky_av.lua
lualib/lua_scanners/oletools.lua
lualib/lua_scanners/savapi.lua
lualib/lua_scanners/sophos.lua

index 352d4dcbf42b78f08814c7774e5a886b59e2a003..855eefac98e86c6aaf0773bbe123194d0e2d978f 100644 (file)
@@ -103,8 +103,8 @@ local function clamav_check(task, content, digest, rule)
           upstream = rule.upstreams:get_upstream_round_robin()
           addr = upstream:get_addr()
 
-          lua_util.debugm(rule.name, task, '%s: retry IP: %s',
-              rule.log_prefix, addr)
+          lua_util.debugm(rule.name, task, '%s: error: %s; retry IP: %s; retries left: %s',
+              rule.log_prefix, err, addr, retransmits)
 
           tcp.request({
             task = task,
index ac79159901874ef2a64c1c111ea3a983b26da100..e82c97cfcd8db4c214706d9c6628ac00b2e3c068 100644 (file)
@@ -146,15 +146,12 @@ local function dcc_check(task, content, digest, rule)
 
           retransmits = retransmits - 1
 
-          lua_util.debugm(rule.name, task, '%s: Request Error: %s - retries left: %s',
-            rule.log_prefix, err, retransmits)
-
           -- Select a different upstream!
           upstream = rule.upstreams:get_upstream_round_robin()
           addr = upstream:get_addr()
 
-          lua_util.debugm(rule.name, task, '%s: retry IP: %s:%s',
-            rule.log_prefix, addr, addr:get_port())
+          lua_util.debugm(rule.name, task, '%s: error: %s; retry IP: %s; retries left: %s',
+              rule.log_prefix, err, addr, retransmits)
 
           tcp.request({
             task = task,
index c4261843433a420035c4433a1100ea2c28dfc63c..8baaeeddef07418db2975d3ebb77297c69cceaee 100644 (file)
@@ -103,7 +103,8 @@ local function fprot_check(task, content, digest, rule)
           upstream = rule.upstreams:get_upstream_round_robin()
           addr = upstream:get_addr()
 
-          lua_util.debugm(rule.name, task, '%s [%s]: retry IP: %s', rule['symbol'], rule['type'], addr)
+          lua_util.debugm(rule.name, task, '%s: error: %s; retry IP: %s; retries left: %s',
+              rule.log_prefix, err, addr, retransmits)
 
           tcp.request({
             task = task,
index cb94c38da94d34370a204864e98bc957bc65d9aa..4bdbdbbfdd49ef2224214d048f1fd29ad61c306d 100644 (file)
@@ -122,8 +122,8 @@ local function kaspersky_check(task, content, digest, rule)
           upstream = rule.upstreams:get_upstream_round_robin()
           addr = upstream:get_addr()
 
-          lua_util.debugm(rule.name, task,
-              '%s [%s]: retry IP: %s', rule['symbol'], rule['type'], addr)
+          lua_util.debugm(rule.name, task, '%s: error: %s; retry IP: %s; retries left: %s',
+              rule.log_prefix, err, addr, retransmits)
 
           tcp.request({
             task = task,
index 8474a1847d7afa751691627ecdd0f2c65587a3a5..05ef15ad96172685c2397401b810e4919b675271 100644 (file)
@@ -106,16 +106,12 @@ local function oletools_check(task, content, digest, rule)
 
           retransmits = retransmits - 1
 
-          lua_util.debugm(rule.name, task,
-              '%s: Request Error: %s - retries left: %s',
-              rule.log_prefix, error, retransmits)
-
           -- Select a different upstream!
           upstream = rule.upstreams:get_upstream_round_robin()
           addr = upstream:get_addr()
 
-          lua_util.debugm(rule.name, task, '%s: retry IP: %s:%s',
-              rule.log_prefix, addr, addr:get_port())
+          lua_util.debugm(rule.name, task, '%s: error: %s; retry IP: %s; retries left: %s',
+              rule.log_prefix, err, addr, retransmits)
 
           tcp.request({
             task = task,
index a8b7b63763b35d94137c06bf6c82600a0721863b..67ded438e579a18dcd93a9bf85e85ae7545e6f28 100644 (file)
@@ -210,9 +210,8 @@ local function savapi_check(task, content, digest, rule)
           upstream = rule.upstreams:get_upstream_round_robin()
           addr = upstream:get_addr()
 
-          lua_util.debugm(rule.name, task,
-              '%s [%s]: retry IP: %s', rule['symbol'],
-              rule['type'], addr)
+          lua_util.debugm(rule.name, task, '%s: error: %s; retry IP: %s; retries left: %s',
+              rule.log_prefix, err, addr, retransmits)
 
           tcp.request({
             task = task,
index ee0407f9b9e8e2611ee223f8fb2ecd1328f30443..9da931c4e51b08ac10c2b8a62c9a63f002ae0a82 100644 (file)
@@ -102,8 +102,8 @@ local function sophos_check(task, content, digest, rule)
           upstream = rule.upstreams:get_upstream_round_robin()
           addr = upstream:get_addr()
 
-          lua_util.debugm(rule.name, task,
-              '%s [%s]: retry IP: %s', rule['symbol'], rule['type'], addr)
+          lua_util.debugm(rule.name, task, '%s: error: %s; retry IP: %s; retries left: %s',
+              rule.log_prefix, err, addr, retransmits)
 
           tcp.request({
             task = task,