diff options
author | Aravinda VK <avishwan@redhat.com> | 2017-06-15 18:09:36 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2017-06-20 06:00:47 +0000 |
commit | 0a8dac38ac4415ea770fb36b34e3c494e8713e6e (patch) | |
tree | b66cd2f3583466bfc2eeb16bdf724e4494cdbc3e /geo-replication/syncdaemon/gsyncdstatus.py | |
parent | 52d0886cfbcdfd69fa0cac0a6d51cd8811d8c6d7 (diff) |
geo-rep: Structured log support
Changed all log messages to structured log format
Change-Id: Idae25f8b4ad0bbae38f4362cbda7bbf51ce7607b
Updates: #240
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: https://review.gluster.org/17551
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/gsyncdstatus.py')
-rw-r--r-- | geo-replication/syncdaemon/gsyncdstatus.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/geo-replication/syncdaemon/gsyncdstatus.py b/geo-replication/syncdaemon/gsyncdstatus.py index dd363baf181..38ca92c73a9 100644 --- a/geo-replication/syncdaemon/gsyncdstatus.py +++ b/geo-replication/syncdaemon/gsyncdstatus.py @@ -20,7 +20,7 @@ from errno import EACCES, EAGAIN, ENOENT import logging from syncdutils import EVENT_GEOREP_ACTIVE, EVENT_GEOREP_PASSIVE, gf_event -from syncdutils import EVENT_GEOREP_CHECKPOINT_COMPLETED +from syncdutils import EVENT_GEOREP_CHECKPOINT_COMPLETED, lf DEFAULT_STATUS = "N/A" MONITOR_STATUS = ("Created", "Started", "Paused", "Stopped") @@ -225,10 +225,10 @@ class GeorepStatus(object): data["checkpoint_time"] = checkpoint_time data["checkpoint_completion_time"] = curr_time data["checkpoint_completed"] = "Yes" - logging.info("Checkpoint completed. Checkpoint " - "Time: %s, Completion Time: %s" % ( - human_time_utc(checkpoint_time), - human_time_utc(curr_time))) + logging.info(lf("Checkpoint completed", + checkpoint_time=human_time_utc( + checkpoint_time), + completion_time=human_time_utc(curr_time))) self.trigger_gf_event_checkpoint_completion( checkpoint_time, curr_time) @@ -238,11 +238,13 @@ class GeorepStatus(object): def set_worker_status(self, status): if self.set_field("worker_status", status): - logging.info("Worker Status: %s" % status) + logging.info(lf("Worker Status Change", + status=status)) def set_worker_crawl_status(self, status): if self.set_field("crawl_status", status): - logging.info("Crawl Status: %s" % status) + logging.info(lf("Crawl Status Change", + status=status)) def set_slave_node(self, slave_node): def merger(data): @@ -269,12 +271,14 @@ class GeorepStatus(object): def set_active(self): if self.set_field("worker_status", "Active"): - logging.info("Worker Status: Active") + logging.info(lf("Worker Status Change", + status="Active")) self.send_event(EVENT_GEOREP_ACTIVE) def set_passive(self): if self.set_field("worker_status", "Passive"): - logging.info("Worker Status: Passive") + logging.info(lf("Worker Status Change", + status="Passive")) self.send_event(EVENT_GEOREP_PASSIVE) def get_monitor_status(self): |