From 5b92a1f467274f77394fc7a303b5c39423537fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 17 Jan 2017 10:54:12 +0200 Subject: [PATCH] Remove explicit module name from log messages The module name doesn't need to be logged as MXS_MODULE_NAME will be automatically added as a prefix to all messages logged by the module. --- .../qc_mysqlembedded/qc_mysqlembedded.cc | 2 +- .../modules/authenticator/MySQLAuth/dbusers.c | 2 +- server/modules/filter/ccrfilter/ccrfilter.c | 6 +- server/modules/filter/dbfwfilter/dbfwfilter.c | 22 +++--- server/modules/filter/luafilter/luafilter.c | 22 +++--- .../namedserverfilter/namedserverfilter.c | 2 +- server/modules/filter/qlafilter/qlafilter.c | 6 +- .../modules/filter/regexfilter/regexfilter.c | 6 +- server/modules/filter/tee/tee.c | 10 +-- server/modules/filter/topfilter/topfilter.c | 4 +- server/modules/monitor/mmmon/mmmon.c | 2 +- server/modules/monitor/mysqlmon/mysql_mon.c | 22 +++--- server/modules/routing/avrorouter/avro.c | 8 +-- .../modules/routing/binlogrouter/blr_master.c | 6 +- server/modules/routing/maxinfo/maxinfo.c | 4 +- .../routing/readconnroute/readconnroute.c | 2 +- .../readwritesplit/rwsplit_route_stmt.c | 4 +- .../routing/schemarouter/schemarouter.c | 68 +++++++++---------- 18 files changed, 98 insertions(+), 100 deletions(-) diff --git a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc index 047e6d873..2f365bc36 100644 --- a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc +++ b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc @@ -2649,7 +2649,7 @@ int32_t qc_mysql_setup(const char* args) { if (args) { - MXS_WARNING("qc_mysqlembedded: '%s' provided as arguments, " + MXS_WARNING("'%s' provided as arguments, " "even though no arguments are supported.", args); } diff --git a/server/modules/authenticator/MySQLAuth/dbusers.c b/server/modules/authenticator/MySQLAuth/dbusers.c index 4b6f1bffa..1297367c1 100644 --- a/server/modules/authenticator/MySQLAuth/dbusers.c +++ b/server/modules/authenticator/MySQLAuth/dbusers.c @@ -1255,7 +1255,7 @@ get_users(SERV_LISTENER *listener, USERS *users) if (server != NULL && (mxs_mysql_real_connect(con, server->server, service_user, dpwd) != NULL)) { - MXS_DEBUG("Dbusers : Loading data from backend database with " + MXS_DEBUG("Loading data from backend database with " "Master role [%s:%i] for service [%s]", server->server->name, server->server->port, diff --git a/server/modules/filter/ccrfilter/ccrfilter.c b/server/modules/filter/ccrfilter/ccrfilter.c index 905fb9103..d50769051 100644 --- a/server/modules/filter/ccrfilter/ccrfilter.c +++ b/server/modules/filter/ccrfilter/ccrfilter.c @@ -188,7 +188,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) } else { - MXS_ERROR("ccrfilter: unsupported option '%s'.", options[i]); + MXS_ERROR("unsupported option '%s'.", options[i]); } } } @@ -199,7 +199,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) { if (regcomp(&my_instance->re, my_instance->match, cflags)) { - MXS_ERROR("ccrfilter: Failed to compile regex '%s'.", my_instance->match); + MXS_ERROR("Failed to compile regex '%s'.", my_instance->match); } } @@ -209,7 +209,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) { if (regcomp(&my_instance->nore, my_instance->nomatch, cflags)) { - MXS_ERROR("ccrfilter: Failed to compile regex '%s'.", my_instance->nomatch); + MXS_ERROR("Failed to compile regex '%s'.", my_instance->nomatch); } } } diff --git a/server/modules/filter/dbfwfilter/dbfwfilter.c b/server/modules/filter/dbfwfilter/dbfwfilter.c index ebce36963..9d27c483d 100644 --- a/server/modules/filter/dbfwfilter/dbfwfilter.c +++ b/server/modules/filter/dbfwfilter/dbfwfilter.c @@ -962,7 +962,7 @@ struct parser_stack */ void dbfw_yyerror(void* scanner, const char* error) { - MXS_ERROR("dbfwfilter: Error on line %d, %s: %s\n", dbfw_yyget_lineno(scanner), + MXS_ERROR("Error on line %d, %s: %s\n", dbfw_yyget_lineno(scanner), error, dbfw_yyget_text(scanner)); } @@ -1332,7 +1332,7 @@ bool define_regex_rule(void* scanner, char* pattern) { PCRE2_UCHAR errbuf[MXS_STRERROR_BUFLEN]; pcre2_get_error_message(err, errbuf, sizeof(errbuf)); - MXS_ERROR("dbfwfilter: Invalid regular expression '%s': %s", + MXS_ERROR("Invalid regular expression '%s': %s", start, errbuf); } @@ -1792,7 +1792,7 @@ static char* create_parse_error(FW_INSTANCE* my_instance, char *msg = NULL; char format[] = - "dbfwfilter: Query could not be %s and will hence be rejected. " + "Query could not be %s and will hence be rejected. " "Please ensure that the SQL syntax is correct"; size_t len = sizeof(format) + strlen(reason); // sizeof includes the trailing NULL as well. char message[len]; @@ -1846,7 +1846,7 @@ bool match_throttle(FW_SESSION* my_session, RULE_BOOK *rulebook, char **msg) *msg = MXS_STRDUP_A(emsg); matches = true; - MXS_INFO("dbfwfilter: rule '%s': user denied for %f seconds", + MXS_INFO("rule '%s': user denied for %f seconds", rulebook->rule->name, blocked_for); } else @@ -1859,7 +1859,7 @@ bool match_throttle(FW_SESSION* my_session, RULE_BOOK *rulebook, char **msg) { if (queryspeed->count >= queryspeed->limit) { - MXS_INFO("dbfwfilter: rule '%s': query limit triggered (%d queries in %d seconds), " + MXS_INFO("rule '%s': query limit triggered (%d queries in %d seconds), " "denying queries from user for %d seconds.", rulebook->rule->name, queryspeed->limit, queryspeed->period, queryspeed->cooldown); @@ -1897,7 +1897,7 @@ void match_regex(RULE_BOOK *rulebook, const char *query, bool *matches, char **m (PCRE2_SPTR)query, PCRE2_ZERO_TERMINATED, 0, 0, mdata, NULL) > 0) { - MXS_NOTICE("dbfwfilter: rule '%s': regex matched on query", rulebook->rule->name); + MXS_NOTICE("rule '%s': regex matched on query", rulebook->rule->name); *matches = true; *msg = MXS_STRDUP_A("Permission denied, query matched regular expression."); } @@ -1928,7 +1928,7 @@ void match_column(RULE_BOOK *rulebook, GWBUF *queue, bool *matches, char **msg) { char emsg[strlen(strln->value) + 100]; sprintf(emsg, "Permission denied to column '%s'.", strln->value); - MXS_NOTICE("dbfwfilter: rule '%s': query targets forbidden column: %s", + MXS_NOTICE("rule '%s': query targets forbidden column: %s", rulebook->rule->name, strln->value); *msg = MXS_STRDUP_A(emsg); *matches = true; @@ -1956,7 +1956,7 @@ void match_function(RULE_BOOK *rulebook, GWBUF *queue, bool *matches, char **msg { char emsg[strlen(strln->value) + 100]; sprintf(emsg, "Permission denied to function '%s'.", strln->value); - MXS_NOTICE("dbfwfilter: rule '%s': query uses forbidden function: %s", + MXS_NOTICE("rule '%s': query uses forbidden function: %s", rulebook->rule->name, strln->value); *msg = MXS_STRDUP_A(emsg); *matches = true; @@ -1977,7 +1977,7 @@ void match_wildcard(RULE_BOOK *rulebook, GWBUF *queue, bool *matches, char **msg { if (strcmp(infos[i].column, "*") == 0) { - MXS_NOTICE("dbfwfilter: rule '%s': query contains a wildcard.", rulebook->rule->name); + MXS_NOTICE("rule '%s': query contains a wildcard.", rulebook->rule->name); *matches = true; *msg = MXS_STRDUP_A("Usage of wildcard denied."); } @@ -2063,7 +2063,7 @@ bool rule_matches(FW_INSTANCE* my_instance, case RT_PERMISSION: matches = true; msg = MXS_STRDUP_A("Permission denied at this time."); - MXS_NOTICE("dbfwfilter: rule '%s': query denied at this time.", rulebook->rule->name); + MXS_NOTICE("rule '%s': query denied at this time.", rulebook->rule->name); break; case RT_COLUMN: @@ -2096,7 +2096,7 @@ bool rule_matches(FW_INSTANCE* my_instance, { matches = true; msg = MXS_STRDUP_A("Required WHERE/HAVING clause is missing."); - MXS_NOTICE("dbfwfilter: rule '%s': query has no where/having " + MXS_NOTICE("rule '%s': query has no where/having " "clause, query is denied.", rulebook->rule->name); } break; diff --git a/server/modules/filter/luafilter/luafilter.c b/server/modules/filter/luafilter/luafilter.c index 3a192492b..a67313127 100644 --- a/server/modules/filter/luafilter/luafilter.c +++ b/server/modules/filter/luafilter/luafilter.c @@ -222,7 +222,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (luaL_dofile(my_instance->global_lua_state, my_instance->global_script)) { - MXS_ERROR("luafilter: Failed to execute global script at '%s':%s.", + MXS_ERROR("Failed to execute global script at '%s':%s.", my_instance->global_script, lua_tostring(my_instance->global_lua_state, -1)); MXS_FREE(my_instance->global_script); MXS_FREE(my_instance->session_script); @@ -235,7 +235,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (lua_pcall(my_instance->global_lua_state, 0, 0, 0)) { - MXS_WARNING("luafilter: Failed to get global variable 'createInstance': %s." + MXS_WARNING("Failed to get global variable 'createInstance': %s." " The createInstance entry point will not be called for the global script.", lua_tostring(my_instance->global_lua_state, -1)); lua_pop(my_instance->global_lua_state, -1); // Pop the error off the stack @@ -299,7 +299,7 @@ static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session) if (luaL_dofile(my_session->lua_state, my_instance->session_script)) { - MXS_ERROR("luafilter: Failed to execute session script at '%s': %s.", + MXS_ERROR("Failed to execute session script at '%s': %s.", my_instance->session_script, lua_tostring(my_session->lua_state, -1)); lua_close(my_session->lua_state); @@ -328,7 +328,7 @@ static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session) if (lua_pcall(my_session->lua_state, 2, 0, 0)) { - MXS_WARNING("luafilter: Failed to get global variable 'newSession': '%s'." + MXS_WARNING("Failed to get global variable 'newSession': '%s'." " The newSession entry point will not be called.", lua_tostring(my_session->lua_state, -1)); lua_pop(my_session->lua_state, -1); // Pop the error off the stack @@ -346,7 +346,7 @@ static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session) if (lua_pcall(my_instance->global_lua_state, 2, 0, 0)) { - MXS_WARNING("luafilter: Failed to get global variable 'newSession': '%s'." + MXS_WARNING("Failed to get global variable 'newSession': '%s'." " The newSession entry point will not be called for the global script.", lua_tostring(my_instance->global_lua_state, -1)); lua_pop(my_instance->global_lua_state, -1); // Pop the error off the stack @@ -380,7 +380,7 @@ static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) if (lua_pcall(my_session->lua_state, 0, 0, 0)) { - MXS_WARNING("luafilter: Failed to get global variable 'closeSession': '%s'." + MXS_WARNING("Failed to get global variable 'closeSession': '%s'." " The closeSession entry point will not be called.", lua_tostring(my_session->lua_state, -1)); lua_pop(my_session->lua_state, -1); @@ -396,7 +396,7 @@ static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session) if (lua_pcall(my_instance->global_lua_state, 0, 0, 0)) { - MXS_WARNING("luafilter: Failed to get global variable 'closeSession': '%s'." + MXS_WARNING("Failed to get global variable 'closeSession': '%s'." " The closeSession entry point will not be called for the global script.", lua_tostring(my_instance->global_lua_state, -1)); lua_pop(my_instance->global_lua_state, -1); @@ -471,7 +471,7 @@ static int32_t clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *session, GW if (lua_pcall(my_session->lua_state, 0, 0, 0)) { - MXS_ERROR("luafilter: Session scope call to 'clientReply' failed: '%s'.", + MXS_ERROR("Session scope call to 'clientReply' failed: '%s'.", lua_tostring(my_session->lua_state, -1)); lua_pop(my_session->lua_state, -1); } @@ -486,7 +486,7 @@ static int32_t clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *session, GW if (lua_pcall(my_instance->global_lua_state, 0, 0, 0)) { - MXS_ERROR("luafilter: Global scope call to 'clientReply' failed: '%s'.", + MXS_ERROR("Global scope call to 'clientReply' failed: '%s'.", lua_tostring(my_session->lua_state, -1)); lua_pop(my_instance->global_lua_state, -1); } @@ -543,7 +543,7 @@ static int32_t routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *session, GWB if (lua_pcall(my_session->lua_state, 1, 1, 0)) { - MXS_ERROR("luafilter: Session scope call to 'routeQuery' failed: '%s'.", + MXS_ERROR("Session scope call to 'routeQuery' failed: '%s'.", lua_tostring(my_session->lua_state, -1)); lua_pop(my_session->lua_state, -1); } @@ -575,7 +575,7 @@ static int32_t routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *session, GWB if (lua_pcall(my_instance->global_lua_state, 1, 0, 0)) { - MXS_ERROR("luafilter: Global scope call to 'routeQuery' failed: '%s'.", + MXS_ERROR("Global scope call to 'routeQuery' failed: '%s'.", lua_tostring(my_instance->global_lua_state, -1)); lua_pop(my_instance->global_lua_state, -1); } diff --git a/server/modules/filter/namedserverfilter/namedserverfilter.c b/server/modules/filter/namedserverfilter/namedserverfilter.c index 4f71f4085..c14aad511 100644 --- a/server/modules/filter/namedserverfilter/namedserverfilter.c +++ b/server/modules/filter/namedserverfilter/namedserverfilter.c @@ -165,7 +165,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (regcomp(&my_instance->re, my_instance->match, cflags)) { - MXS_ERROR("namedserverfilter: Invalid regular expression '%s'.", my_instance->match); + MXS_ERROR("Invalid regular expression '%s'.", my_instance->match); MXS_FREE(my_instance->match); my_instance->match = NULL; error = true; diff --git a/server/modules/filter/qlafilter/qlafilter.c b/server/modules/filter/qlafilter/qlafilter.c index eb6722b94..d4baab7b1 100644 --- a/server/modules/filter/qlafilter/qlafilter.c +++ b/server/modules/filter/qlafilter/qlafilter.c @@ -295,7 +295,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (my_instance->match && regcomp(&my_instance->re, my_instance->match, cflags)) { - MXS_ERROR("qlafilter: Invalid regular expression '%s' for the 'match' " + MXS_ERROR("Invalid regular expression '%s' for the 'match' " "parameter.", my_instance->match); MXS_FREE(my_instance->match); my_instance->match = NULL; @@ -304,7 +304,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (my_instance->nomatch && regcomp(&my_instance->nore, my_instance->nomatch, cflags)) { - MXS_ERROR("qlafilter: Invalid regular expression '%s' for the 'nomatch'" + MXS_ERROR("Invalid regular expression '%s' for the 'nomatch'" " parameter.", my_instance->nomatch); MXS_FREE(my_instance->nomatch); my_instance->nomatch = NULL; @@ -715,7 +715,7 @@ static FILE* open_log_file(uint32_t data_flags, QLA_INSTANCE *instance, const ch { // Weird error, file opened but a write failed. Best to stop. fclose(fp); - MXS_ERROR("qlafilter: Failed to print header to file %s.", filename); + MXS_ERROR("Failed to print header to file %s.", filename); return NULL; } } diff --git a/server/modules/filter/regexfilter/regexfilter.c b/server/modules/filter/regexfilter/regexfilter.c index 175e175e0..7eec9d8b0 100644 --- a/server/modules/filter/regexfilter/regexfilter.c +++ b/server/modules/filter/regexfilter/regexfilter.c @@ -198,7 +198,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) { if ((my_instance->logfile = fopen(logfile, "a")) == NULL) { - MXS_ERROR("regexfilter: Failed to open file '%s'.", logfile); + MXS_ERROR("Failed to open file '%s'.", logfile); free_instance(my_instance); return NULL; } @@ -220,7 +220,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) { char errbuffer[1024]; pcre2_get_error_message(errnumber, (PCRE2_UCHAR*) & errbuffer, sizeof(errbuffer)); - MXS_ERROR("regexfilter: Compiling regular expression '%s' failed at %lu: %s", + MXS_ERROR("Compiling regular expression '%s' failed at %lu: %s", my_instance->match, erroffset, errbuffer); free_instance(my_instance); return NULL; @@ -229,7 +229,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if ((my_instance->match_data = pcre2_match_data_create_from_pattern(my_instance->re, NULL)) == NULL) { - MXS_ERROR("regexfilter: Failure to create PCRE2 matching data. " + MXS_ERROR("Failure to create PCRE2 matching data. " "This is most likely caused by a lack of available memory."); free_instance(my_instance); return NULL; diff --git a/server/modules/filter/tee/tee.c b/server/modules/filter/tee/tee.c index 1496a9705..7babcdcd0 100644 --- a/server/modules/filter/tee/tee.c +++ b/server/modules/filter/tee/tee.c @@ -254,7 +254,7 @@ orphan_free(void* data) #ifdef SS_DEBUG if (o_stopping + o_ready > 0) { - MXS_DEBUG("tee.c: %d orphans in " + MXS_DEBUG("%d orphans in " "SESSION_STATE_STOPPING, %d orphans in " "SESSION_STATE_ROUTER_READY. ", o_stopping, o_ready); } @@ -278,7 +278,7 @@ orphan_free(void* data) } #ifdef SS_DEBUG - MXS_DEBUG("tee.c: %d orphans freed.", o_freed); + MXS_DEBUG("%d orphans freed.", o_freed); #endif } @@ -379,7 +379,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (my_instance->match && regcomp(&my_instance->re, my_instance->match, cflags)) { - MXS_ERROR("tee: Invalid regular expression '%s' for the match parameter.", + MXS_ERROR("Invalid regular expression '%s' for the match parameter.", my_instance->match); MXS_FREE(my_instance->match); MXS_FREE(my_instance->nomatch); @@ -391,7 +391,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (my_instance->nomatch && regcomp(&my_instance->nore, my_instance->nomatch, cflags)) { - MXS_ERROR("tee: Invalid regular expression '%s' for the nomatch paramter.", + MXS_ERROR("Invalid regular expression '%s' for the nomatch paramter.", my_instance->nomatch); if (my_instance->match) { @@ -927,7 +927,7 @@ int reset_session_state(TEE_SESSION* my_session, GWBUF* buffer) { case 0x1b: my_session->client_multistatement = *((unsigned char*) buffer->start + 5); - MXS_INFO("tee: client %s multistatements", + MXS_INFO("client %s multistatements", my_session->client_multistatement ? "enabled" : "disabled"); case 0x03: case 0x16: diff --git a/server/modules/filter/topfilter/topfilter.c b/server/modules/filter/topfilter/topfilter.c index 7ec9a4fff..e618cf3e4 100644 --- a/server/modules/filter/topfilter/topfilter.c +++ b/server/modules/filter/topfilter/topfilter.c @@ -213,7 +213,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (my_instance->match && regcomp(&my_instance->re, my_instance->match, cflags)) { - MXS_ERROR("topfilter: Invalid regular expression '%s'" + MXS_ERROR("Invalid regular expression '%s'" " for the 'match' parameter.", my_instance->match); regfree(&my_instance->re); @@ -224,7 +224,7 @@ createInstance(const char *name, char **options, CONFIG_PARAMETER *params) if (my_instance->exclude && regcomp(&my_instance->exre, my_instance->exclude, cflags)) { - MXS_ERROR("topfilter: Invalid regular expression '%s'" + MXS_ERROR("Invalid regular expression '%s'" " for the 'nomatch' parameter.\n", my_instance->exclude); regfree(&my_instance->exre); diff --git a/server/modules/monitor/mmmon/mmmon.c b/server/modules/monitor/mmmon/mmmon.c index 9353db716..b91b93e57 100644 --- a/server/modules/monitor/mmmon/mmmon.c +++ b/server/modules/monitor/mmmon/mmmon.c @@ -574,7 +574,7 @@ monitorMain(void *arg) !(ptr->pending_status & SERVER_MASTER)) { /* in this case server->status will not be updated from pending_status */ - MXS_NOTICE("[mysql_mon]: root server [%s:%i] is no longer Master, let's " + MXS_NOTICE("root server [%s:%i] is no longer Master, let's " "use it again even if it could be a stale master, you have " "been warned!", ptr->server->name, ptr->server->port); /* Set the STALE bit for this server in server struct */ diff --git a/server/modules/monitor/mysqlmon/mysql_mon.c b/server/modules/monitor/mysqlmon/mysql_mon.c index e119c1545..9f38044dd 100644 --- a/server/modules/monitor/mysqlmon/mysql_mon.c +++ b/server/modules/monitor/mysqlmon/mysql_mon.c @@ -1442,7 +1442,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas if (handle->master == NULL) { - MXS_ERROR("[mysql_mon]: set_master_heartbeat called without an available Master server"); + MXS_ERROR("set_master_heartbeat called without an available Master server"); return; } @@ -1450,7 +1450,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas if (mysql_query(database->con, "SELECT table_name FROM information_schema.tables " "WHERE table_schema = 'maxscale_schema' AND table_name = 'replication_heartbeat'")) { - MXS_ERROR( "[mysql_mon]: Error checking for replication_heartbeat in Master server" + MXS_ERROR( "Error checking for replication_heartbeat in Master server" ": %s", mysql_error(database->con)); database->server->rlag = -1; } @@ -1478,7 +1478,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas "PRIMARY KEY ( master_server_id, maxscale_id ) ) " "ENGINE=MYISAM DEFAULT CHARSET=latin1")) { - MXS_ERROR("[mysql_mon]: Error creating maxscale_schema.replication_heartbeat " + MXS_ERROR("Error creating maxscale_schema.replication_heartbeat " "table in Master server: %s", mysql_error(database->con)); database->server->rlag = -1; @@ -1493,7 +1493,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas if (mysql_query(database->con, heartbeat_purge_query)) { - MXS_ERROR("[mysql_mon]: Error deleting from maxscale_schema.replication_heartbeat " + MXS_ERROR("Error deleting from maxscale_schema.replication_heartbeat " "table: [%s], %s", heartbeat_purge_query, mysql_error(database->con)); @@ -1514,7 +1514,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas database->server->rlag = -1; - MXS_ERROR("[mysql_mon]: Error updating maxscale_schema.replication_heartbeat table: [%s], %s", + MXS_ERROR("Error updating maxscale_schema.replication_heartbeat table: [%s], %s", heartbeat_insert_query, mysql_error(database->con)); } @@ -1532,7 +1532,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas database->server->rlag = -1; - MXS_ERROR("[mysql_mon]: Error inserting into " + MXS_ERROR("Error inserting into " "maxscale_schema.replication_heartbeat table: [%s], %s", heartbeat_insert_query, mysql_error(database->con)); @@ -1542,7 +1542,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas /* Set replication lag to 0 for the master */ database->server->rlag = 0; - MXS_DEBUG("[mysql_mon]: heartbeat table inserted data for %s:%i", + MXS_DEBUG("heartbeat table inserted data for %s:%i", database->server->name, database->server->port); } } @@ -1551,7 +1551,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas /* Set replication lag as 0 for the master */ database->server->rlag = 0; - MXS_DEBUG("[mysql_mon]: heartbeat table updated for Master %s:%i", + MXS_DEBUG("heartbeat table updated for Master %s:%i", database->server->name, database->server->port); } } @@ -1576,7 +1576,7 @@ static void set_slave_heartbeat(MONITOR* mon, MONITOR_SERVERS *database) if (handle->master == NULL) { - MXS_ERROR("[mysql_mon]: set_slave_heartbeat called without an available Master server"); + MXS_ERROR("set_slave_heartbeat called without an available Master server"); return; } @@ -1648,14 +1648,14 @@ static void set_slave_heartbeat(MONITOR* mon, MONITOR_SERVERS *database) if (handle->master->server->node_id < 0) { - MXS_ERROR("[mysql_mon]: error: replication heartbeat: " + MXS_ERROR("error: replication heartbeat: " "master_server_id NOT available for %s:%i", database->server->name, database->server->port); } else { - MXS_ERROR("[mysql_mon]: error: replication heartbeat: " + MXS_ERROR("error: replication heartbeat: " "failed selecting from hearthbeat table of %s:%i : [%s], %s", database->server->name, database->server->port, diff --git a/server/modules/routing/avrorouter/avro.c b/server/modules/routing/avrorouter/avro.c index b53ed69cf..5b8d2e802 100644 --- a/server/modules/routing/avrorouter/avro.c +++ b/server/modules/routing/avrorouter/avro.c @@ -481,13 +481,13 @@ createInstance(SERVICE *service, char **options) } else { - MXS_WARNING("[avrorouter] Unknown router option: '%s'", options[i]); + MXS_WARNING("Unknown router option: '%s'", options[i]); err = true; } } else { - MXS_WARNING("[avrorouter] Unknown router option: '%s'", options[i]); + MXS_WARNING("Unknown router option: '%s'", options[i]); err = true; } } @@ -602,7 +602,7 @@ createInstance(SERVICE *service, char **options) /* Start the scan, read, convert AVRO task */ conversion_task_ctl(inst, true); - MXS_INFO("AVRO: current MySQL binlog file is %s, pos is %lu\n", + MXS_INFO("current MySQL binlog file is %s, pos is %lu\n", inst->binlog_name, inst->current_pos); return (ROUTER *) inst; @@ -625,7 +625,7 @@ newSession(ROUTER *instance, SESSION *session) AVRO_INSTANCE *inst = (AVRO_INSTANCE *) instance; AVRO_CLIENT *client; - MXS_DEBUG("avrorouter: %lu [newSession] new router session with " + MXS_DEBUG("%lu [newSession] new router session with " "session %p, and inst %p.", pthread_self(), session, inst); if ((client = (AVRO_CLIENT *) MXS_CALLOC(1, sizeof(AVRO_CLIENT))) == NULL) diff --git a/server/modules/routing/binlogrouter/blr_master.c b/server/modules/routing/binlogrouter/blr_master.c index 19009a862..dd4f56aa6 100644 --- a/server/modules/routing/binlogrouter/blr_master.c +++ b/server/modules/routing/binlogrouter/blr_master.c @@ -171,7 +171,7 @@ blr_start_master(void* data) spinlock_release(&router->lock); if ((client = dcb_alloc(DCB_ROLE_INTERNAL, NULL)) == NULL) { - MXS_ERROR("Binlog router: failed to create DCB for dummy client"); + MXS_ERROR("failed to create DCB for dummy client"); return; } router->client = client; @@ -179,7 +179,7 @@ blr_start_master(void* data) client->data = CreateMySQLAuthData(router->user, router->password, ""); if ((router->session = session_alloc(router->service, client)) == NULL) { - MXS_ERROR("Binlog router: failed to create session for connection to master"); + MXS_ERROR("failed to create session for connection to master"); return; } client->session = router->session; @@ -198,7 +198,7 @@ blr_start_master(void* data) { router->retry_backoff = BLR_MAX_BACKOFF; } - MXS_ERROR("Binlog router: failed to connect to master server '%s'", + MXS_ERROR("failed to connect to master server '%s'", router->service->dbref->server->unique_name); return; } diff --git a/server/modules/routing/maxinfo/maxinfo.c b/server/modules/routing/maxinfo/maxinfo.c index fc676a4c7..469a1a8d2 100644 --- a/server/modules/routing/maxinfo/maxinfo.c +++ b/server/modules/routing/maxinfo/maxinfo.c @@ -367,7 +367,7 @@ execute(ROUTER *rinstance, void *router_session, GWBUF *queue) case COM_QUIT: break; default: - MXS_ERROR("maxinfo: Unexpected MySQL command 0x%x", + MXS_ERROR("Unexpected MySQL command 0x%x", MYSQL_COMMAND(queue)); break; } @@ -603,7 +603,7 @@ maxinfo_execute_query(INFO_INSTANCE *instance, INFO_SESSION *session, char *sql) MAXINFO_TREE *tree; PARSE_ERROR err; - MXS_INFO("maxinfo: SQL statement: '%s' for 0x%p.", + MXS_INFO("SQL statement: '%s' for 0x%p.", sql, session->dcb); if (strcmp(sql, "select @@version_comment limit 1") == 0) { diff --git a/server/modules/routing/readconnroute/readconnroute.c b/server/modules/routing/readconnroute/readconnroute.c index b63f4019e..c3eb20350 100644 --- a/server/modules/routing/readconnroute/readconnroute.c +++ b/server/modules/routing/readconnroute/readconnroute.c @@ -442,7 +442,7 @@ newSession(ROUTER *instance, SESSION *session) CHK_CLIENT_RSES(client_rses); - MXS_INFO("Readconnroute: New session for server %s. Connections : %d", + MXS_INFO("New session for server %s. Connections : %d", candidate->server->unique_name, candidate->connections); return(void *) client_rses; diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.c b/server/modules/routing/readwritesplit/rwsplit_route_stmt.c index 5865b8f72..3ec81ccbb 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.c +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.c @@ -1000,9 +1000,7 @@ bool handle_hinted_target(ROUTER_CLIENT_SES *rses, GWBUF *querybuf, * backend server. */ named_server = hint->data; - MXS_INFO("Hint: route to server " - "'%s'", - named_server); + MXS_INFO("Hint: route to server '%s'", named_server); } else if (hint->type == HINT_PARAMETER && (strncasecmp((char *)hint->data, "max_slave_replication_lag", diff --git a/server/modules/routing/schemarouter/schemarouter.c b/server/modules/routing/schemarouter/schemarouter.c index b050c6111..edeed58d0 100644 --- a/server/modules/routing/schemarouter/schemarouter.c +++ b/server/modules/routing/schemarouter/schemarouter.c @@ -305,7 +305,7 @@ showdb_response_t parse_showdb_response(ROUTER_CLIENT_SES* rses, backend_ref_t* if (PTR_IS_ERR(ptr)) { - MXS_INFO("schemarouter: SHOW DATABASES returned an error."); + MXS_INFO("SHOW DATABASES returned an error."); gwbuf_free(buf); return SHOWDB_FATAL_ERROR; } @@ -320,7 +320,7 @@ showdb_response_t parse_showdb_response(ROUTER_CLIENT_SES* rses, backend_ref_t* if (ptr >= (unsigned char*) buf->end) { - MXS_INFO("schemarouter: Malformed packet for SHOW DATABASES."); + MXS_INFO("Malformed packet for SHOW DATABASES."); *buffer = gwbuf_append(buf, *buffer); return SHOWDB_FATAL_ERROR; } @@ -341,7 +341,7 @@ showdb_response_t parse_showdb_response(ROUTER_CLIENT_SES* rses, backend_ref_t* { if (hashtable_add(rses->shardmap->hash, data, target)) { - MXS_INFO("schemarouter: <%s, %s>", target, data); + MXS_INFO("<%s, %s>", target, data); } else { @@ -368,12 +368,12 @@ showdb_response_t parse_showdb_response(ROUTER_CLIENT_SES* rses, backend_ref_t* if (ptr < (unsigned char*) buf->end && PTR_IS_EOF(ptr) && bref->n_mapping_eof == 1) { atomic_add(&bref->n_mapping_eof, 1); - MXS_INFO("schemarouter: SHOW DATABASES fully received from %s.", + MXS_INFO("SHOW DATABASES fully received from %s.", bref->bref_backend->server->unique_name); } else { - MXS_INFO("schemarouter: SHOW DATABASES partially received from %s.", + MXS_INFO("SHOW DATABASES partially received from %s.", bref->bref_backend->server->unique_name); } @@ -434,7 +434,7 @@ int gen_databaselist(ROUTER_INSTANCE* inst, ROUTER_CLIENT_SES* session) clone = gwbuf_clone(buffer); dcb = session->rses_backend_ref[i].bref_dcb; rval |= !dcb->func.write(dcb, clone); - MXS_DEBUG("schemarouter: Wrote SHOW DATABASES to %s for session %p: returned %d", + MXS_DEBUG("Wrote SHOW DATABASES to %s for session %p: returned %d", session->rses_backend_ref[i].bref_backend->server->unique_name, session->rses_client_dcb->session, rval); @@ -481,7 +481,7 @@ char* get_shard_target_name(ROUTER_INSTANCE* router, /** Warn about improper usage of the router */ if (rval && strcmp(name, rval) != 0) { - MXS_ERROR("Schemarouter: Query targets databases on servers '%s' and '%s'. " + MXS_ERROR("Query targets databases on servers '%s' and '%s'. " "Cross database queries across servers are not supported.", rval, name); } @@ -489,7 +489,7 @@ char* get_shard_target_name(ROUTER_INSTANCE* router, { rval = name; has_dbs = true; - MXS_INFO("schemarouter: Query targets database '%s' on server '%s'", dbnms[i], rval); + MXS_INFO("Query targets database '%s' on server '%s'", dbnms[i], rval); } } } @@ -513,7 +513,7 @@ char* get_shard_target_name(ROUTER_INSTANCE* router, if (tmp) { - MXS_INFO("schemarouter: SHOW TABLES with specific database '%s' on server '%s'", tok, tmp); + MXS_INFO("SHOW TABLES with specific database '%s' on server '%s'", tok, tmp); } } MXS_FREE(query); @@ -521,7 +521,7 @@ char* get_shard_target_name(ROUTER_INSTANCE* router, if (tmp == NULL) { rval = (char*) hashtable_fetch(ht, client->current_db); - MXS_INFO("schemarouter: SHOW TABLES query, current database '%s' on server '%s'", + MXS_INFO("SHOW TABLES query, current database '%s' on server '%s'", client->current_db, rval); } else @@ -541,7 +541,7 @@ char* get_shard_target_name(ROUTER_INSTANCE* router, if (strcmp(srvnm, buffer->hint->data) == 0) { rval = srvnm; - MXS_INFO("schemarouter: Routing hint found (%s)", srvnm); + MXS_INFO("Routing hint found (%s)", srvnm); } } } @@ -556,7 +556,7 @@ char* get_shard_target_name(ROUTER_INSTANCE* router, rval = (char*) hashtable_fetch(ht, client->current_db); if (rval) { - MXS_INFO("schemarouter: Using active database '%s'", client->current_db); + MXS_INFO("Using active database '%s'", client->current_db); } } } @@ -704,7 +704,7 @@ static ROUTER* createInstance(SERVICE *service, char **options) if ((config_get_param(conf, "auth_all_servers")) == NULL) { - MXS_NOTICE("Schemarouter: Authentication data is fetched from all servers. To disable this " + MXS_NOTICE("Authentication data is fetched from all servers. To disable this " "add 'auth_all_servers=0' to the service."); service->users_from_all = true; } @@ -767,7 +767,7 @@ static ROUTER* createInstance(SERVICE *service, char **options) if (value == NULL) { - MXS_ERROR("Unknown router options for Schemarouter: %s", options[i]); + MXS_ERROR("Unknown router options for %s", options[i]); failure = true; break; } @@ -797,7 +797,7 @@ static ROUTER* createInstance(SERVICE *service, char **options) } else { - MXS_ERROR("Unknown router options for Schemarouter: %s", options[i]); + MXS_ERROR("Unknown router options for %s", options[i]); failure = true; break; } @@ -871,13 +871,13 @@ static void* newSession(ROUTER* router_inst, SESSION* session) strcpy(db, data->db); *data->db = 0; using_db = true; - MXS_INFO("schemarouter: Client logging in directly to a database '%s', " + MXS_INFO("Client logging in directly to a database '%s', " "postponing until databases have been mapped.", db); } if (!have_db) { - MXS_INFO("schemarouter: Client'%s' connecting with empty database.", data->user); + MXS_INFO("Client'%s' connecting with empty database.", data->user); } spinlock_release(&session->ses_lock); @@ -1665,7 +1665,7 @@ static int routeQuery(ROUTER* instance, { int init_rval = 1; char* querystr = modutil_get_SQL(querybuf); - MXS_INFO("schemarouter: Storing query for session %p: %s", + MXS_INFO("Storing query for session %p: %s", router_cli_ses->rses_client_dcb->session, querystr); MXS_FREE(querystr); @@ -1897,14 +1897,14 @@ static int routeQuery(ROUTER* instance, if (tname) { - MXS_INFO("schemarouter: INIT_DB for database '%s' on server '%s'", + MXS_INFO("INIT_DB for database '%s' on server '%s'", router_cli_ses->current_db, tname); route_target = TARGET_NAMED_SERVER; targetserver = MXS_STRDUP_A(tname); } else { - MXS_INFO("schemarouter: INIT_DB with unknown database"); + MXS_INFO("INIT_DB with unknown database"); } spinlock_release(&router_cli_ses->shardmap->lock); } @@ -1927,7 +1927,7 @@ static int routeQuery(ROUTER* instance, } else { - MXS_INFO("schemarouter: Backend server '%s' is not in a viable state", tname); + MXS_INFO("Backend server '%s' is not in a viable state", tname); /** * Shard is not a viable target right now so we check @@ -1956,7 +1956,7 @@ static int routeQuery(ROUTER* instance, */ route_target = TARGET_ANY; - MXS_INFO("schemarouter: Routing query to first available backend."); + MXS_INFO("Routing query to first available backend."); } else @@ -2032,7 +2032,7 @@ static int routeQuery(ROUTER* instance, if (TARGET_IS_ANY(route_target)) { /**No valid backends alive*/ - MXS_ERROR("Schemarouter: Failed to route query, no backends are available."); + MXS_ERROR("Failed to route query, no backends are available."); rses_end_locked_router_action(router_cli_ses); ret = 0; goto retblock; @@ -2290,7 +2290,7 @@ static void clientReply(ROUTER* instance, return; } - MXS_DEBUG("schemarouter: Reply from [%s] session [%p]" + MXS_DEBUG("Reply from [%s] session [%p]" " mapping [%s] queries queued [%s]", bref->bref_backend->server->unique_name, router_cli_ses->rses_client_dcb->session, @@ -2364,7 +2364,7 @@ static void clientReply(ROUTER* instance, if (router_cli_ses->init & INIT_USE_DB) { - MXS_DEBUG("schemarouter: Reply to USE '%s' received for session %p", + MXS_DEBUG("Reply to USE '%s' received for session %p", router_cli_ses->connect_db, router_cli_ses->rses_client_dcb->session); router_cli_ses->init &= ~INIT_USE_DB; @@ -2465,7 +2465,7 @@ static void clientReply(ROUTER* instance, unsigned char* cmd = (unsigned char*) writebuf->start; int state = router_cli_ses->init; /** Write reply to client DCB */ - MXS_INFO("schemarouter: returning reply [%s] " + MXS_INFO("returning reply [%s] " "state [%s] session [%p]", PTR_IS_ERR(cmd) ? "ERR" : PTR_IS_OK(cmd) ? "OK" : "RSET", state & INIT_UNINT ? "UNINIT" : state & INIT_MAPPING ? "MAPPING" : "READY", @@ -3861,7 +3861,7 @@ static int router_handle_state_switch(DCB* dcb, { case DCB_REASON_NOT_RESPONDING: atomic_add(&bref->bref_backend->connections, -1); - MXS_INFO("schemarouter: server %s not responding", srv->unique_name); + MXS_INFO("server %s not responding", srv->unique_name); dcb->func.hangup(dcb); break; @@ -4057,7 +4057,7 @@ bool handle_default_db(ROUTER_CLIENT_SES *router_cli_ses) if (get_shard_dcb(&dcb, router_cli_ses, target)) { dcb->func.write(dcb, buffer); - MXS_DEBUG("schemarouter: USE '%s' sent to %s for session %p", + MXS_DEBUG("USE '%s' sent to %s for session %p", router_cli_ses->connect_db, target, router_cli_ses->rses_client_dcb->session); @@ -4065,7 +4065,7 @@ bool handle_default_db(ROUTER_CLIENT_SES *router_cli_ses) } else { - MXS_INFO("schemarouter: Couldn't find target DCB for '%s'.", target); + MXS_INFO("Couldn't find target DCB for '%s'.", target); } } else @@ -4076,7 +4076,7 @@ bool handle_default_db(ROUTER_CLIENT_SES *router_cli_ses) else { /** Unknown database, hang up on the client*/ - MXS_INFO("schemarouter: Connecting to a non-existent database '%s'", + MXS_INFO("Connecting to a non-existent database '%s'", router_cli_ses->connect_db); char errmsg[128 + MYSQL_DATABASE_MAXLEN + 1]; sprintf(errmsg, "Unknown database '%s'", router_cli_ses->connect_db); @@ -4101,7 +4101,7 @@ void route_queued_query(ROUTER_CLIENT_SES *router_cli_ses) tmp->next = NULL; #ifdef SS_DEBUG char* querystr = modutil_get_SQL(tmp); - MXS_DEBUG("schemarouter: Sending queued buffer for session %p: %s", + MXS_DEBUG("Sending queued buffer for session %p: %s", router_cli_ses->rses_client_dcb->session, querystr); MXS_FREE(querystr); @@ -4137,7 +4137,7 @@ int inspect_backend_mapping_states(ROUTER_CLIENT_SES *router_cli_ses, if (rc == SHOWDB_FULL_RESPONSE) { router_cli_ses->rses_backend_ref[i].bref_mapped = true; - MXS_DEBUG("schemarouter: Received SHOW DATABASES reply from %s for session %p", + MXS_DEBUG("Received SHOW DATABASES reply from %s for session %p", router_cli_ses->rses_backend_ref[i].bref_backend->server->unique_name, router_cli_ses->rses_client_dcb->session); } @@ -4145,7 +4145,7 @@ int inspect_backend_mapping_states(ROUTER_CLIENT_SES *router_cli_ses, { bref->map_queue = writebuf; writebuf = NULL; - MXS_DEBUG("schemarouter: Received partial SHOW DATABASES reply from %s for session %p", + MXS_DEBUG("Received partial SHOW DATABASES reply from %s for session %p", router_cli_ses->rses_backend_ref[i].bref_backend->server->unique_name, router_cli_ses->rses_client_dcb->session); } @@ -4198,7 +4198,7 @@ int inspect_backend_mapping_states(ROUTER_CLIENT_SES *router_cli_ses, if (BREF_IS_IN_USE(&bkrf[i]) && !BREF_IS_MAPPED(&bkrf[i])) { mapped = false; - MXS_DEBUG("schemarouter: Still waiting for reply to SHOW DATABASES from %s for session %p", + MXS_DEBUG("Still waiting for reply to SHOW DATABASES from %s for session %p", bkrf[i].bref_backend->server->unique_name, router_cli_ses->rses_client_dcb->session); }