summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--geo-replication/syncdaemon/gsyncd.py1
-rw-r--r--geo-replication/syncdaemon/master.py1
-rw-r--r--geo-replication/syncdaemon/resource.py4
-rw-r--r--geo-replication/syncdaemon/syncdutils.py17
4 files changed, 21 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/gsyncd.py b/geo-replication/syncdaemon/gsyncd.py
index 84b26a41145..ee2a9b334d3 100644
--- a/geo-replication/syncdaemon/gsyncd.py
+++ b/geo-replication/syncdaemon/gsyncd.py
@@ -244,6 +244,7 @@ def main_i():
default=os.devnull, type=str, action='callback',
callback=store_abs)
op.add_option('--gluster-log-level', metavar='LVL')
+ op.add_option('--changelog-log-level', metavar='LVL', default="INFO")
op.add_option('--gluster-params', metavar='PRMS', default='')
op.add_option(
'--glusterd-uuid', metavar='UUID', type=str, default='',
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 7d015aee718..b5ddac05c29 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -700,7 +700,6 @@ class GMasterChangelogMixin(GMasterCommon):
# flat directory hierarchy for gfid based access
FLAT_DIR_HIERARCHY = '.'
- CHANGELOG_LOG_LEVEL = 9
CHANGELOG_CONN_RETRIES = 5
def archive_and_purge_changelogs(self, changelogs):
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 312d488d6a9..c66ded6e4a2 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -37,6 +37,7 @@ from syncdutils import GsyncdError, select, privileged, boolify, funcode
from syncdutils import umask, entry2pb, gauxpfx, errno_wrap, lstat
from syncdutils import NoStimeAvailable, PartialHistoryAvailable
from syncdutils import ChangelogException, ChangelogHistoryNotAvailable
+from syncdutils import get_changelog_log_level
from syncdutils import CHANGELOG_AGENT_CLIENT_VERSION
from gsyncdstatus import GeorepStatus
@@ -1555,7 +1556,8 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote):
changelog_agent.init()
changelog_agent.register(gconf.local_path,
workdir, gconf.changelog_log_file,
- g2.CHANGELOG_LOG_LEVEL,
+ get_changelog_log_level(
+ gconf.changelog_log_level),
g2.CHANGELOG_CONN_RETRIES)
register_time = int(time.time())
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py
index ea10fcb8817..8629850cd40 100644
--- a/geo-replication/syncdaemon/syncdutils.py
+++ b/geo-replication/syncdaemon/syncdutils.py
@@ -518,3 +518,20 @@ class ChangelogException(OSError):
def gf_event(event_type, **kwargs):
from events.gf_event import gf_event as gfevent
gfevent(event_type, **kwargs)
+
+
+class GlusterLogLevel(object):
+ NONE = 0
+ EMERG = 1
+ ALERT = 2
+ CRITICAL = 3
+ ERROR = 4
+ WARNING = 5
+ NOTICE = 6
+ INFO = 7
+ DEBUG = 8
+ TRACE = 9
+
+
+def get_changelog_log_level(lvl):
+ return getattr(GlusterLogLevel, lvl, GlusterLogLevel.INFO)