Added a new configuration parameter that allows the user to control
whether authentication warning messages are logged.
This commit is contained in:
Markus Makela
2015-11-03 11:03:47 +02:00
parent d6230e68ef
commit d57b4cd531
6 changed files with 54 additions and 28 deletions

View File

@ -1122,19 +1122,21 @@ getAllUsers(SERVICE *service, USERS *users)
} else if(rc == -1) {
/** Duplicate user*/
LOGIF(LT,(skygw_log_write(LT,
"Duplicate MySQL user found for service [%s]: %s@%s%s%s",
service->name,
row[0],row[1],havedb?" for database: ":"",
havedb ?dbnm:"")));
if (service->log_auth_warnings)
{
skygw_log_write(LM, "Duplicate MySQL user found for service"
" [%s]: %s@%s%s%s", service->name, row[0],
row[1], havedb ? " for database: " : "",
havedb ? dbnm : "");
}
} else {
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR|LOGFILE_TRACE,
"Warning: Failed to add user %s@%s for service [%s]. "
"This user will be unavailable via MaxScale.",
row[0],
row[1],
service->name)));
if (service->log_auth_warnings)
{
skygw_log_write_flush(LM, "Warning: Failed to add user %s@%s"
" for service [%s]. This user will be "
"unavailable via MaxScale.", row[0],
row[1], service->name);
}
}
}
@ -1657,19 +1659,20 @@ getUsers(SERVICE *service, USERS *users)
} else if(rc == -1) {
/** Duplicate user*/
LOGIF(LE,(skygw_log_write(LT|LE,
"Warning: Duplicate MySQL user found for service [%s]: %s@%s%s%s",
service->name,
row[0],row[1],db_grants?" for database: ":"",
db_grants ?row[5]:"")));
if (service->log_auth_warnings)
{
skygw_log_write(LM, "Warning: Duplicate MySQL user found for "
"service [%s]: %s@%s%s%s", service->name, row[0],
row[1], db_grants ? " for database: " : "",
db_grants ? row[5] : "");
}
} else {
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR|LOGFILE_TRACE,
"Warning: Failed to add user %s@%s for service [%s]. "
"This user will be unavailable via MaxScale.",
row[0],
row[1],
service->name)));
if (service->log_auth_warnings)
{
skygw_log_write_flush(LM, "Warning: Failed to add user %s@%s for"
" service [%s]. This user will be unavailable"
" via MaxScale.", row[0], row[1], service->name);
}
}
}