From 948e40cb29094f7bcef14c34963cb4d4f3e7ce5f Mon Sep 17 00:00:00 2001 From: apoorvad Date: Tue, 1 Dec 2015 12:22:38 -0800 Subject: [PATCH] Change ciwatch.log location In order to make puppet-ciwatch in sync with ciwatch, change the log file location to /var/log/ciwatch/ciwatch.log from /var/lib/ciwatch/ciwatch.log Change-Id: Id3713cbafca3f87db0cf24dc00e800b56e148a41 --- ciwatch.conf.sample | 3 +++ ciwatch/config.py | 2 ++ ciwatch/log.py | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ciwatch.conf.sample b/ciwatch.conf.sample index 5b94e88..2d4493c 100644 --- a/ciwatch.conf.sample +++ b/ciwatch.conf.sample @@ -8,6 +8,9 @@ gerrit_port = 29418 debug = True data_dir = /var/data +[Log] +log_dir = /var/log/ciwatch + [database] connection = sqlite:///:memory diff --git a/ciwatch/config.py b/ciwatch/config.py index 4cf838e..65aabbe 100644 --- a/ciwatch/config.py +++ b/ciwatch/config.py @@ -21,6 +21,8 @@ class Config(object): def __init__(self): self.cfg = self.get_config() + if not self.cfg.Log.log_dir: + self.cfg.Log.log_dir = '/var/log/ciwatch' if self.cfg.Data.data_dir: self.DATA_DIR = self.cfg.Data.data_dir else: diff --git a/ciwatch/log.py b/ciwatch/log.py index 419c6b7..37958be 100644 --- a/ciwatch/log.py +++ b/ciwatch/log.py @@ -38,4 +38,4 @@ def setup_logger(name): return logger -logger = setup_logger(config.DATA_DIR + '/ciwatch.log') +logger = setup_logger(config.cfg.Log.log_dir + '/ciwatch.log')