]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] populate missing log keys in plugins, lualib
authorAndrew Lewis <nerf@judo.za.org>
Thu, 15 Jan 2026 12:06:37 +0000 (14:06 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Thu, 15 Jan 2026 12:06:37 +0000 (14:06 +0200)
12 files changed:
lualib/lua_scanners/avast.lua
lualib/lua_scanners/kaspersky_av.lua
lualib/lua_scanners/kaspersky_se.lua
lualib/lua_scanners/savapi.lua
lualib/plugins/neural.lua
src/plugins/lua/asn.lua
src/plugins/lua/dcc.lua
src/plugins/lua/history_redis.lua
src/plugins/lua/neural.lua
src/plugins/lua/p0f.lua
src/plugins/lua/ratelimit.lua
src/plugins/lua/settings.lua

index 7e778979ae512df0f5ea0f007ff5fa09b64739d8..6bbb046ce701e693fa75b92ce15373dcd467a953 100644 (file)
@@ -118,7 +118,7 @@ local function avast_check(task, content, digest, rule, maybe_part)
     local message_fd = rspamd_util.create_file(fname)
 
     if not message_fd then
-      rspamd_logger.errx('cannot store file for avast scan: %s', fname)
+      rspamd_logger.errx(task, 'cannot store file for avast scan: %s', fname)
       return
     end
 
index d52cef041904190b28bf4061fa7ad93bbd156bdc..6ae6b620e33b4bf23e5cd62fe710c63bfffc23ae 100644 (file)
@@ -90,7 +90,7 @@ local function kaspersky_check(task, content, digest, rule, maybe_part)
     local clamav_compat_cmd = string.format("nSCAN %s\n", fname)
 
     if not message_fd then
-      rspamd_logger.errx('cannot store file for kaspersky scan: %s', fname)
+      rspamd_logger.errx(task, 'cannot store file for kaspersky scan: %s', fname)
       return
     end
 
index 10a3e0f475cd60c5104de4d3492a560d26314981..7bef586e1416fc7c2bcecb97c8a9d02da8f2d2ac 100644 (file)
@@ -141,7 +141,7 @@ local function kaspersky_se_check(task, content, digest, rule, maybe_part)
       local message_fd = rspamd_util.create_file(fname)
 
       if not message_fd then
-        rspamd_logger.errx('cannot store file for kaspersky_se scan: %s', fname)
+        rspamd_logger.errx(task, 'cannot store file for kaspersky_se scan: %s', fname)
         return
       end
 
index 08f7b6682e3294bcc339ba90560460f71cc63e22..293b8f3b5401055931970e2c94f0262799a73746 100644 (file)
@@ -91,7 +91,7 @@ local function savapi_check(task, content, digest, rule)
     local message_fd = rspamd_util.create_file(fname)
 
     if not message_fd then
-      rspamd_logger.errx('cannot store file for savapi scan: %s', fname)
+      rspamd_logger.errx(task, 'cannot store file for savapi scan: %s', fname)
       return
     end
 
index 756da552b7d69e4ff583b976c6b4bf36696476f7..5b4ffc033959ba956fe482cf566774334c4a64b4 100644 (file)
@@ -903,7 +903,7 @@ local function spawn_train(params)
           1 - params.rule.roc_misclassification_cost)
         roc_thresholds = { spam_threshold, ham_threshold }
 
-        rspamd_logger.messagex("ROC thresholds: (spam_threshold: %s, ham_threshold: %s)",
+        rspamd_logger.messagex(rspamd_config, "ROC thresholds: (spam_threshold: %s, ham_threshold: %s)",
           roc_thresholds[1], roc_thresholds[2])
       end
 
index 24da19eb473b67edeb877f697a8710c6ed802923..8604dd0bbcdf079b2583dc8a3740e924bb173cb4 100644 (file)
@@ -121,11 +121,11 @@ local configure_asn_module = function()
   if options['provider_type'] == 'rspamd' then
     if not options['provider_info'] and options['provider_info']['ip4'] and
         options['provider_info']['ip6'] then
-      rspamd_logger.errx("Missing required provider_info for rspamd")
+      rspamd_logger.errx(rspamd_config, "Missing required provider_info for rspamd")
       return false
     end
   else
-    rspamd_logger.errx("Unknown provider_type: %s", options['provider_type'])
+    rspamd_logger.errx(rspamd_config, "Unknown provider_type: %s", options['provider_type'])
     return false
   end
 
index ff01edf9d7faaeb87c4ac8f376e3972500db3fc5..f3838a2897fbbc4fdf26582616407ba544a78bb9 100644 (file)
@@ -124,5 +124,5 @@ if rule then
   })
 else
   lua_util.disable_module(N, "config")
-  rspamd_logger.infox('DCC module not configured');
+  rspamd_logger.infox(rspamd_config, 'DCC module not configured');
 end
index 212735f7b0252947821a6bf39e0d401c3e3fdc86..a15ec0fdc18025f7417e56ff0a0288e3aafe34f7 100644 (file)
@@ -160,7 +160,7 @@ local function history_save(task)
   if data then
     normalise_results(data, task)
   else
-    rspamd_logger.errx('cannot get protocol reply, skip saving in history')
+    rspamd_logger.errx(task, 'cannot get protocol reply, skip saving in history')
     return
   end
 
index 8d9859f8a9a0ac0e882221b7bd8d3dc4c7f20eef..d8fa89cf6db349be50dab69a1ee1b7aa129ba1be 100644 (file)
@@ -590,7 +590,7 @@ local function load_new_ann(rule, ev_base, set, profile, min_diff)
             rspamd_logger.infox(rspamd_config,
               'loaded ROC thresholds for %s:%s; version=%s',
               rule.prefix, set.name, profile.version)
-            rspamd_logger.debugx("ROC thresholds: %s", roc_thresholds)
+            rspamd_logger.debugx(rspamd_config, "ROC thresholds: %s", roc_thresholds)
           end
         end
 
@@ -1038,7 +1038,7 @@ for k, r in pairs(rules) do
   end
 
   if rule_elt.max_inputs and not has_blas then
-    rspamd_logger.errx('cannot set max inputs to %s as BLAS is not compiled in',
+    rspamd_logger.errx(rspamd_config, 'cannot set max inputs to %s as BLAS is not compiled in',
       rule_elt.name, rule_elt.max_inputs)
     rule_elt.max_inputs = nil
   end
index 8c681fa4e399b6aa9068ec6a739791e12a4da1a2..8bb59ec2b243329b94026385d1132b027b32ee7b 100644 (file)
@@ -120,5 +120,5 @@ if rule then
   end
 else
   lua_util.disable_module(N, 'config')
-  rspamd_logger.infox('p0f module not configured');
+  rspamd_logger.infox(rspamd_config, 'p0f module not configured');
 end
index d463658fa9d4bd2bb9335bdfcaf7881c3283761c..f2a2978afe759cc05de8b7564fa8c724ccb1ba8f 100644 (file)
@@ -373,7 +373,7 @@ local function ratelimit_cb(task)
   local function gen_check_cb(prefix, bucket, lim_name, lim_key)
     return function(err, data)
       if err then
-        rspamd_logger.errx('cannot check limit %s: %s', prefix, err)
+        rspamd_logger.errx(task, 'cannot check limit %s: %s', prefix, err)
       elseif type(data) == 'table' and data[1] then
         lua_util.debugm(N, task,
             "got reply for limit %s (%s / %s); %s burst, %s:%s dyn, %s leaked",
@@ -476,7 +476,7 @@ local function maybe_cleanup_pending(task)
         local bucket = v.bucket
         local function cleanup_cb(err, data)
           if err then
-            rspamd_logger.errx('cannot cleanup limit %s: %s', k, err)
+            rspamd_logger.errx(task, 'cannot cleanup limit %s: %s', k, err)
           else
             lua_util.debugm(N, task, 'cleaned pending bucked for %s: %s', k, data)
           end
index c1f5fcdb472a476011e3ad536925eefddb518a81..f46443a13d735bb66bfeefe77444d2766c8ace6c 100644 (file)
@@ -353,7 +353,7 @@ local function check_settings(task)
       -- No more selection logic
       return
     else
-      rspamd_logger.infox("cannot query selector to make external map request")
+      rspamd_logger.infox(task, "cannot query selector to make external map request")
     end
   end
 
@@ -409,7 +409,7 @@ local function check_settings(task)
               -- No more selection logic
               return
             else
-              rspamd_logger.infox("cannot query selector to make external map request")
+              rspamd_logger.infox(task, "cannot query selector to make external map request")
             end
           end
           if s.rule['symbols'] then