ensure that they contain the expected values. This command is restricted and
can only be issued on sockets configured for levels "operator" or "admin".
-show errors [<iid>]
+show errors [<iid>|<proxy>]
Dump last known request and response errors collected by frontends and
backends. If <iid> is specified, the limit the dump to errors concerning
- either frontend or backend whose ID is <iid>. This command is restricted
- and can only be issued on sockets configured for levels "operator" or
- "admin".
+ either frontend or backend whose ID is <iid>. Proxy ID "-1" will cause
+ all instances to be dumped. If a proxy name is specified instead, its ID
+ will be used as the filter. This command is restricted and can only be
+ issued on sockets configured for levels "operator" or "admin".
The errors which may be collected are the last request and response errors
caused by protocol violations, often due to invalid characters in header
if (!cli_has_level(appctx, ACCESS_LVL_OPER))
return 1;
- if (*args[2])
- appctx->ctx.errors.iid = atoi(args[2]);
+ if (*args[2]) {
+ struct proxy *px;
+
+ px = proxy_find_by_name(args[2], 0, 0);
+ if (px)
+ appctx->ctx.errors.iid = px->uuid;
+ else
+ appctx->ctx.errors.iid = atoi(args[2]);
+
+ if (!appctx->ctx.errors.iid) {
+ appctx->ctx.cli.msg = "No such proxy.\n";
+ appctx->st0 = CLI_ST_PRINT;
+ return 1;
+ }
+ }
else
- appctx->ctx.errors.iid = -1;
+ appctx->ctx.errors.iid = -1; // dump all proxies
+
appctx->ctx.errors.px = NULL;
return 0;
}