since up to 64 threads per group may be configured. The maximum number of
groups is configured at compile time and defaults to 16. See also "nbthread".
+trace <args...>
+ This command configures one "trace" subsystem statement. Each of them can be
+ found in the management manual, and follow the exact same syntax. Only one
+ statement per line is permitted (i.e. if some long trace configurations using
+ semi-colons are to be imported, they must be placed one per line). Any output
+ that the "trace" command would produce will be emitted during the parsing
+ step of the section. Most of the time these will be errors and warnings, but
+ certain incomplete commands might list permissible choices. This command is
+ not meant for regular use, it will generally only be suggested by developers
+ along complex debugging sessions. For this reason it is internally marked as
+ experimental, meaning that "expose-experimental-directives" must appear on a
+ line before any "trace" statement. Note that these directives are parsed on
+ the fly, so referencing a ring buffer that is only declared further will not
+ work. For such use cases it is suggested to place another "global" section
+ with only the "trace" statements after the declaration of that ring. It is
+ important to keep in mind that depending on the trace level and details,
+ enabling traces can severely degrade the global performance. Please refer to
+ the management manual for the statements syntax.
+
uid <number>
Changes the process's user ID to <number>. It is recommended that the user ID
is dedicated to HAProxy or to a small set of similar daemons. HAProxy must
#include <import/ist.h>
#include <haproxy/api.h>
#include <haproxy/buf.h>
+#include <haproxy/cfgparse.h>
#include <haproxy/cli.h>
#include <haproxy/errors.h>
#include <haproxy/istbuf.h>
}
+/* parse a "trace" statement in the "global" section, returns 1 if a message is returned, otherwise zero */
+static int cfg_parse_trace(char **args, int section_type, struct proxy *curpx,
+ const struct proxy *defpx, const char *file, int line,
+ char **err)
+{
+ const char *msg;
+ int severity;
+
+ severity = trace_parse_statement(args, &msg);
+ if (msg) {
+ if (severity >= LOG_NOTICE)
+ ha_notice("parsing [%s:%d] : '%s': %s\n", file, line, args[0], msg);
+ else if (severity >= LOG_WARNING)
+ ha_warning("parsing [%s:%d] : '%s': %s\n", file, line, args[0], msg);
+ else {
+ ha_alert("parsing [%s:%d] : '%s': %s\n", file, line, args[0], msg);
+ return -1;
+ }
+ }
+ return 0;
+}
+
/* parse the command, returns 1 if a message is returned, otherwise zero */
static int cli_parse_trace(char **args, char *payload, struct appctx *appctx, void *private)
{
INITCALL1(STG_REGISTER, cli_register_kw, &cli_kws);
+static struct cfg_kw_list cfg_kws = {ILH, {
+ { CFG_GLOBAL, "trace", cfg_parse_trace, KWF_EXPERIMENTAL },
+ { /* END */ },
+}};
+
+INITCALL1(STG_REGISTER, cfg_register_keywords, &cfg_kws);
+
/*
* Local variables:
* c-indent-level: 8