server/modules/monitor LOGIFs and skygw_write_logs removed.
All LOGIFs and skygw_log_writes replaced with MXS_[ERROR| WARNING|NOTICE|INFO|DEBUG] macros.
This commit is contained in:
@ -75,10 +75,7 @@ version()
|
||||
void
|
||||
ModuleInit()
|
||||
{
|
||||
LOGIF(LM, (skygw_log_write(
|
||||
LOGFILE_MESSAGE,
|
||||
"Initialise the MySQL Cluster Monitor module %s.\n",
|
||||
version_str)));
|
||||
MXS_NOTICE("Initialise the MySQL Cluster Monitor module %s.", version_str);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,10 +154,10 @@ startMonitor(void *arg, void* opt)
|
||||
}
|
||||
if (script_error)
|
||||
{
|
||||
skygw_log_write(LE, "Error: Errors were found in the script configuration parameters "
|
||||
"for the monitor '%s'. The script will not be used.", mon->name);
|
||||
free(handle->script);
|
||||
handle->script = NULL;
|
||||
MXS_ERROR("Errors were found in the script configuration parameters "
|
||||
"for the monitor '%s'. The script will not be used.",mon->name);
|
||||
free(handle->script);
|
||||
handle->script = NULL;
|
||||
}
|
||||
/** If no specific events are given, enable them all */
|
||||
if (!have_events)
|
||||
@ -286,8 +283,9 @@ monitorDatabase(MONITOR_SERVERS *database, char *defaultUser, char *defaultPassw
|
||||
if (mysql_field_count(database->con) < 2)
|
||||
{
|
||||
mysql_free_result(result);
|
||||
skygw_log_write(LE, "Error: Unexpected result for \"SHOW STATUS LIKE 'Ndb_number_of_ready_data_nodes'\". Expected 2 columns."
|
||||
" MySQL Version: %s", version_str);
|
||||
MXS_ERROR("Unexpected result for \"SHOW STATUS LIKE "
|
||||
"'Ndb_number_of_ready_data_nodes'\". Expected 2 columns."
|
||||
" MySQL Version: %s", version_str);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -306,8 +304,9 @@ monitorDatabase(MONITOR_SERVERS *database, char *defaultUser, char *defaultPassw
|
||||
if (mysql_field_count(database->con) < 2)
|
||||
{
|
||||
mysql_free_result(result);
|
||||
skygw_log_write(LE, "Error: Unexpected result for \"SHOW STATUS LIKE 'Ndb_cluster_node_id'\". Expected 2 columns."
|
||||
" MySQL Version: %s", version_str);
|
||||
MXS_ERROR("Unexpected result for \"SHOW STATUS LIKE 'Ndb_cluster_node_id'\". "
|
||||
"Expected 2 columns."
|
||||
" MySQL Version: %s", version_str);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -356,10 +355,8 @@ monitorMain(void *arg)
|
||||
|
||||
if (mysql_thread_init())
|
||||
{
|
||||
LOGIF(LE, (skygw_log_write_flush(
|
||||
LOGFILE_ERROR,
|
||||
"Fatal : mysql_thread_init failed in monitor "
|
||||
"module. Exiting.\n")));
|
||||
MXS_ERROR("Fatal : mysql_thread_init failed in monitor "
|
||||
"module. Exiting.");
|
||||
return;
|
||||
}
|
||||
handle->status = MONITOR_RUNNING;
|
||||
@ -400,12 +397,10 @@ monitorMain(void *arg)
|
||||
if (ptr->server->status != ptr->mon_prev_status ||
|
||||
SERVER_IS_DOWN(ptr->server))
|
||||
{
|
||||
LOGIF(LD, (skygw_log_write_flush(
|
||||
LOGFILE_DEBUG,
|
||||
"Backend server %s:%d state : %s",
|
||||
ptr->server->name,
|
||||
ptr->server->port,
|
||||
STRSRVSTATUS(ptr->server))));
|
||||
MXS_DEBUG("Backend server %s:%d state : %s",
|
||||
ptr->server->name,
|
||||
ptr->server->port,
|
||||
STRSRVSTATUS(ptr->server));
|
||||
}
|
||||
|
||||
ptr = ptr->next;
|
||||
@ -422,10 +417,10 @@ monitorMain(void *arg)
|
||||
evtype = mon_get_event_type(ptr);
|
||||
if (isNdbEvent(evtype))
|
||||
{
|
||||
skygw_log_write(LOGFILE_TRACE, "Server changed state: %s[%s:%u]: %s",
|
||||
ptr->server->unique_name,
|
||||
ptr->server->name, ptr->server->port,
|
||||
mon_get_event_name(ptr));
|
||||
MXS_INFO("Server changed state: %s[%s:%u]: %s",
|
||||
ptr->server->unique_name,
|
||||
ptr->server->name, ptr->server->port,
|
||||
mon_get_event_name(ptr));
|
||||
if (handle->script && handle->events[evtype])
|
||||
{
|
||||
monitor_launch_script(mon, ptr, handle->script);
|
||||
|
||||
Reference in New Issue
Block a user