]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: lua: change tune.lua.log.stderr default from 'on' to 'auto'
authorTristan <tristan@mangadex.org>
Mon, 23 Oct 2023 12:35:40 +0000 (13:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Oct 2023 05:49:03 +0000 (07:49 +0200)
After making it configurable in previous commit "MINOR: lua: Add flags
to configure logging behaviour", this patch changes the default value
of tune.lua.log.stderr from 'on' (unconditionally forward LUA logs to
stderr) to 'auto' (only forward LUA logs to stderr if logging via a
standard logger is disabled, or none is configured for the current context)

Since this is a change in behaviour, it shouldn't be backported

doc/configuration.txt
doc/lua-api/index.rst
doc/lua.txt
src/hlua.c

index a3c048323100af48c4b4db30d3353d6512144fdb..3dcdb3e2ade5aa115bda098b7b8e0fbe9b59530d 100644 (file)
@@ -3212,7 +3212,7 @@ tune.lua.log.stderr { on | auto | off }
   Please note that, when enabled, this logging is in addition to the logging
   configured via tune.lua.log.loggers.
 
-  Defaults to 'on'.
+  Defaults to 'auto'.
 
 tune.max-checks-per-thread <number>
   Sets the number of active checks per thread above which a thread will
index 50ade4e5b7901cbe37969f3fea0ffee43b7d6d49..5716312973e70d39e156e3e2627d99ab6952abf6 100644 (file)
@@ -267,7 +267,7 @@ Core class
   **context**: body, init, task, action, sample-fetch, converter
 
   This function sends a log. The log is sent, according with the HAProxy
-  configuration file, to the loggers relevant to the current context and
+  configuration file, to the loggers relevant to the current context and/or
   to stderr if it is allowed.
 
   The exact behaviour depends on tune.lua.log.loggers and tune.lua.log.stderr.
@@ -2650,7 +2650,7 @@ TXN class
 .. js:function:: TXN.log(TXN, loglevel, msg)
 
   This function sends a log. The log is sent, according with the HAProxy
-  configuration file, to the loggers relevant to the current context and
+  configuration file, to the loggers relevant to the current context and/or
   to stderr if it is allowed.
 
   The exact behaviour depends on tune.lua.log.loggers and tune.lua.log.stderr.
index 25db8a30470f4b60a13c37eb20f3fc54331bb309..edc400558246c02bebf02fed858da1763a4b6551 100644 (file)
@@ -631,8 +631,9 @@ It displays a log during the HAProxy startup:
    [alert] 285/083533 (14465) : Hello World !
 
 Note: By default, logs originating from a LUA script are sent to the loggers
-applicable to the current context, if any, and additionally to stderr. See
-tune.lua.log.loggers and tune.lua.log.stderr for more information.
+applicable to the current context, if any. If none are configured for use,
+logs are instead sent to stderr. See tune.lua.log.loggers and tune.lua.log.stderr
+for more information.
 
 Default path and libraries
 --------------------------
index 7c83237ff528b7c1b3264aa2ad82a7f7204d9131..7e0580d3596d807f2763dd0270541f2c6584aaef 100644 (file)
@@ -81,7 +81,7 @@ enum hlua_log_opt {
        HLUA_LOG_STDERR_MASK     = 0x00000030,
 };
 /* default log options, made of flags in hlua_log_opt */
-static uint hlua_log_opts = HLUA_LOG_LOGGERS_ON | HLUA_LOG_STDERR_ON;
+static uint hlua_log_opts = HLUA_LOG_LOGGERS_ON | HLUA_LOG_STDERR_AUTO;
 
 /* Lua uses longjmp to perform yield or throwing errors. This
  * macro is used only for identifying the function that can
@@ -1381,8 +1381,8 @@ const char *hlua_show_current_location(const char *pfx)
 }
 
 /* This function is used to send logs. It tries to send them to:
- * - the log target applicable in the current context, AND
- * - stderr if not in quiet mode or explicitly disabled
+ * - the log target applicable in the current context, OR
+ * - stderr when no logger is in use for the current context
  */
 static inline void hlua_sendlog(struct proxy *px, int level, const char *msg)
 {