diff --git a/include/proxysql_admin.h b/include/proxysql_admin.h index a93ae0683..7d6710e94 100644 --- a/include/proxysql_admin.h +++ b/include/proxysql_admin.h @@ -95,6 +95,9 @@ struct admin_metrics_map_idx { }; }; +// ProxySQL_Admin shared variables +extern int admin__web_verbosity; + class ProxySQL_Admin { private: volatile int main_shutdown; @@ -167,6 +170,7 @@ class ProxySQL_Admin { int restapi_port_old; bool web_enabled; bool web_enabled_old; + int web_verbosity; int web_port; int web_port_old; int p_memory_metrics_interval; diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 311b68093..2ca1ab233 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -71,6 +71,8 @@ extern char *ssl_key_fp; extern char *ssl_cert_fp; extern char *ssl_ca_fp; +// ProxySQL_Admin shared variables +int admin___web_verbosity = 0; MARIADB_CHARSET_INFO * proxysql_find_charset_name(const char *name); @@ -540,6 +542,7 @@ static char * admin_variables_names[]= { (char *)"restapi_port", (char *)"web_enabled", (char *)"web_port", + (char *)"web_verbosity", (char *)"prometheus_memory_metrics_interval", #ifdef DEBUG (char *)"debug", @@ -5120,6 +5123,7 @@ ProxySQL_Admin::ProxySQL_Admin() : variables.web_enabled_old = false; variables.web_port = 6080; variables.web_port_old = variables.web_port; + variables.web_verbosity = 0; variables.p_memory_metrics_interval = 61; #ifdef DEBUG variables.debug=GloVars.global.gdbg; @@ -5811,6 +5815,8 @@ void ProxySQL_Admin::flush_admin_variables___database_to_runtime(SQLite3DB *db, variables.web_port_old = variables.web_port; } } + // Update the admin variable for 'web_verbosity' + admin___web_verbosity = variables.web_verbosity; } } if (resultset) delete resultset; @@ -6846,6 +6852,10 @@ char * ProxySQL_Admin::get_variable(char *name) { if (!strcasecmp(name,"web_enabled")) { return strdup((variables.web_enabled ? "true" : "false")); } + if (!strcasecmp(name,"web_verbosity")) { + sprintf(intbuf, "%d", variables.web_verbosity); + return strdup(intbuf); + } if (!strcasecmp(name,"web_port")) { sprintf(intbuf,"%d",variables.web_port); return strdup(intbuf); @@ -7369,6 +7379,15 @@ bool ProxySQL_Admin::set_variable(char *name, char *value) { // this is the pub return false; } } + if (!strcasecmp(name,"web_verbosity")) { + int intv=atoi(value); + if (intv >= 0 && intv <= 10) { + variables.web_verbosity=intv; + return true; + } else { + return false; + } + } if (!strcasecmp(name,"cluster_mysql_query_rules_save_to_disk")) { bool rt = false; if (strcasecmp(value,"true")==0 || strcasecmp(value,"1")==0) {