Updated logging messages

Updated logging messages
This commit is contained in:
MassimilianoPinto
2015-06-08 17:30:26 +02:00
parent 809cdb5b1e
commit d9234bec5f
2 changed files with 24 additions and 16 deletions

View File

@ -159,10 +159,12 @@ GWBUF *buf;
return;
}
router->master->remote = strdup(router->service->dbref->server->name);
LOGIF(LM,(skygw_log_write(
LOGFILE_MESSAGE,
"%s: attempting to connect to master server %s.",
router->service->name, router->master->remote)));
LOGIF(LM,(skygw_log_write(
LOGFILE_MESSAGE,
"%s: attempting to connect to master server %s:%d, binlog %s, pos %lu",
router->service->name, router->service->dbref->server->name, router->service->dbref->server->port, router->binlog_name, router->binlog_position)));
router->connect_time = time(0);
if (setsockopt(router->master->fd, SOL_SOCKET, SO_KEEPALIVE, &keepalive , sizeof(keepalive )))
@ -581,12 +583,13 @@ char query[128];
buf = blr_make_binlog_dump(router);
router->master_state = BLRM_BINLOGDUMP;
router->master->func.write(router->master, buf);
LOGIF(LM,(skygw_log_write(
LOGFILE_MESSAGE,
"%s: Request binlog records from %s at "
"position %d from master server %s.",
LOGIF(LM,(skygw_log_write(
LOGFILE_MESSAGE,
"%s: Request binlog records from %s at "
"position %lu from master server %s:%d",
router->service->name, router->binlog_name,
router->binlog_position, router->master->remote)));
router->binlog_position, router->master->remote,
router->service->dbref->server->port)));
break;
case BLRM_BINLOGDUMP:
// Main body, we have received a binlog record from the master

View File

@ -2201,13 +2201,15 @@ static int
blr_stop_slave(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave)
{
GWBUF *ptr;
LOGIF(LM, (skygw_log_write(LOGFILE_MESSAGE, "%s: STOP SLAVE received by %s@%s. Disconnecting from master %s:%d",
router->service->name,
LOGIF(LM, (skygw_log_write(
LOGFILE_MESSAGE,
"%s: STOP SLAVE received by %s@%s. Disconnecting from master %s:%d, read up to log %s, pos %lu",
router->service->name,
slave->dcb->user,
slave->dcb->remote,
router->service->dbref->server->name,
router->service->dbref->server->port)));
router->service->dbref->server->port,
router->binlog_name, router->binlog_position)));
if (router->master_state != BLRM_SLAVE_STOPPED) {
@ -2257,12 +2259,15 @@ blr_stop_slave(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave)
static int
blr_start_slave(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave)
{
LOGIF(LM, (skygw_log_write(LOGFILE_MESSAGE, "%s: START SLAVE received by %s@%s. Trying connection to master %s:%d",
router->service->name,
LOGIF(LM, (skygw_log_write(
LOGFILE_MESSAGE,
"%s: START SLAVE received by %s@%s. Trying connection to master %s:%d, binlog %s, pos %lu",
router->service->name,
slave->dcb->user,
slave->dcb->remote,
router->service->dbref->server->name,
router->service->dbref->server->port)));
router->service->dbref->server->port,
router->binlog_name, router->binlog_position)));
if ( (router->master_state == BLRM_UNCONNECTED) || (router->master_state == BLRM_SLAVE_STOPPED) ) {