aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-18 11:51:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-18 11:51:17 +0100
commitf5b203c98ace2eb818f8497af293bea2967ed83d (patch)
tree2371073b948793f5f6fe9006ebd6d7f9083d375b /lualib
parentf41ac57b3a61a1abfe562a930734a45f36ba5604 (diff)
downloadrspamd-f5b203c98ace2eb818f8497af293bea2967ed83d.tar.gz
rspamd-f5b203c98ace2eb818f8497af293bea2967ed83d.zip
[Minor] Lua_scanners: Improve logging
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_scanners/clamav.lua4
-rw-r--r--lualib/lua_scanners/dcc.lua7
-rw-r--r--lualib/lua_scanners/fprot.lua3
-rw-r--r--lualib/lua_scanners/kaspersky_av.lua4
-rw-r--r--lualib/lua_scanners/oletools.lua8
-rw-r--r--lualib/lua_scanners/savapi.lua5
-rw-r--r--lualib/lua_scanners/sophos.lua4
7 files changed, 14 insertions, 21 deletions
diff --git a/lualib/lua_scanners/clamav.lua b/lualib/lua_scanners/clamav.lua
index 352d4dcbf..855eefac9 100644
--- a/lualib/lua_scanners/clamav.lua
+++ b/lualib/lua_scanners/clamav.lua
@@ -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,
diff --git a/lualib/lua_scanners/dcc.lua b/lualib/lua_scanners/dcc.lua
index ac7915990..e82c97cfc 100644
--- a/lualib/lua_scanners/dcc.lua
+++ b/lualib/lua_scanners/dcc.lua
@@ -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,
diff --git a/lualib/lua_scanners/fprot.lua b/lualib/lua_scanners/fprot.lua
index c42618434..8baaeedde 100644
--- a/lualib/lua_scanners/fprot.lua
+++ b/lualib/lua_scanners/fprot.lua
@@ -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,
diff --git a/lualib/lua_scanners/kaspersky_av.lua b/lualib/lua_scanners/kaspersky_av.lua
index cb94c38da..4bdbdbbfd 100644
--- a/lualib/lua_scanners/kaspersky_av.lua
+++ b/lualib/lua_scanners/kaspersky_av.lua
@@ -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,
diff --git a/lualib/lua_scanners/oletools.lua b/lualib/lua_scanners/oletools.lua
index 8474a1847..05ef15ad9 100644
--- a/lualib/lua_scanners/oletools.lua
+++ b/lualib/lua_scanners/oletools.lua
@@ -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,
diff --git a/lualib/lua_scanners/savapi.lua b/lualib/lua_scanners/savapi.lua
index a8b7b6376..67ded438e 100644
--- a/lualib/lua_scanners/savapi.lua
+++ b/lualib/lua_scanners/savapi.lua
@@ -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,
diff --git a/lualib/lua_scanners/sophos.lua b/lualib/lua_scanners/sophos.lua
index ee0407f9b..9da931c4e 100644
--- a/lualib/lua_scanners/sophos.lua
+++ b/lualib/lua_scanners/sophos.lua
@@ -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,