From 3fb59e020bcff8e85e5a33c662789ceb64ee8d08 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Thu, 9 Apr 2015 22:07:53 +0300 Subject: [PATCH] Added more logging to trace log. --- server/core/dbusers.c | 16 ++++++++-------- server/modules/routing/readconnroute.c | 16 +++------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/server/core/dbusers.c b/server/core/dbusers.c index fc37515a8..7d3e26880 100644 --- a/server/core/dbusers.c +++ b/server/core/dbusers.c @@ -973,7 +973,7 @@ getAllUsers(SERVICE *service, USERS *users) if(havedb && wildcard_db_grant(dbnm)) { rc = add_wildcard_users(users, row[0], row[1], password, row[4], dbnm, service->resources); - skygw_log_write(LOGFILE_DEBUG,"%s: Converted '%s' to %d individual database grants.",service->name,dbnm,rc); + skygw_log_write(LOGFILE_DEBUG|LOGFILE_TRACE,"%s: Converted '%s' to %d individual database grants.",service->name,dbnm,rc); } else { @@ -1005,7 +1005,7 @@ getAllUsers(SERVICE *service, USERS *users) /* Log the user being added with its db grants */ LOGIF(LD, (skygw_log_write_flush( - LOGFILE_DEBUG, + LOGFILE_DEBUG|LOGFILE_TRACE, "%s: User %s@%s for database %s added to " "service user table.", service->name, @@ -1015,7 +1015,7 @@ getAllUsers(SERVICE *service, USERS *users) } else { /* Log the user being added (without db grants) */ LOGIF(LD, (skygw_log_write_flush( - LOGFILE_DEBUG, + LOGFILE_DEBUG|LOGFILE_TRACE, "%s: User %s@%s added to service user table.", service->name, row[0], @@ -1028,7 +1028,7 @@ getAllUsers(SERVICE *service, USERS *users) total_users++; } else { LOGIF(LE, (skygw_log_write_flush( - LOGFILE_ERROR, + LOGFILE_ERROR|LOGFILE_TRACE, "Warning: Failed to add user %s@%s for service [%s]. " "This user will be unavailable via MaxScale.", row[0], @@ -1457,7 +1457,7 @@ getUsers(SERVICE *service, USERS *users) if(wildcard_db_grant(row[5])) { rc = add_wildcard_users(users, row[0], row[1], password, row[4], row[5], service->resources); - skygw_log_write(LOGFILE_DEBUG,"%s: Converted '%s' to %d individual database grants.",service->name,row[5],rc); + skygw_log_write(LOGFILE_DEBUG|LOGFILE_TRACE,"%s: Converted '%s' to %d individual database grants.",service->name,row[5],rc); } else { @@ -1486,7 +1486,7 @@ getUsers(SERVICE *service, USERS *users) /* Log the user being added with its db grants */ LOGIF(LD, (skygw_log_write_flush( - LOGFILE_DEBUG, + LOGFILE_DEBUG|LOGFILE_TRACE, "%s: User %s@%s for database %s added to " "service user table.", service->name, @@ -1496,7 +1496,7 @@ getUsers(SERVICE *service, USERS *users) } else { /* Log the user being added (without db grants) */ LOGIF(LD, (skygw_log_write_flush( - LOGFILE_DEBUG, + LOGFILE_DEBUG|LOGFILE_TRACE, "%s: User %s@%s added to service user table.", service->name, row[0], @@ -1509,7 +1509,7 @@ getUsers(SERVICE *service, USERS *users) total_users++; } else { LOGIF(LE, (skygw_log_write_flush( - LOGFILE_ERROR, + LOGFILE_ERROR|LOGFILE_TRACE, "Warning: Failed to add user %s@%s for service [%s]. " "This user will be unavailable via MaxScale.", row[0], diff --git a/server/modules/routing/readconnroute.c b/server/modules/routing/readconnroute.c index 783fb5d8b..b4b080c16 100644 --- a/server/modules/routing/readconnroute.c +++ b/server/modules/routing/readconnroute.c @@ -755,20 +755,10 @@ routeQuery(ROUTER *instance, void *router_session, GWBUF *queue) break; } - CHK_PROTOCOL(((MySQLProtocol*)backend_dcb->protocol)); - LOGIF(LD, (skygw_log_write( - LOGFILE_DEBUG, - "%lu [readconnroute:routeQuery] Routed command %d to dcb %p " - "with return value %d.", - pthread_self(), - mysql_command, - backend_dcb, - rc))); - LOGIF(LOGFILE_TRACE,skygw_log_write( - LOGFILE_TRACE, - "Routed command [%#x] to '%s'%s%s", - mysql_command, + LOGFILE_DEBUG|LOGFILE_TRACE, + "Routed [%s] to '%s'%s%s", + STRPACKETTYPE(mysql_command), backend_dcb->server->unique_name, trc?": ":".", trc?trc:""));