Browse Source

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
changes/50/252050/5
apoorvad 3 years ago
parent
commit
948e40cb29
3 changed files with 6 additions and 1 deletions
  1. 3
    0
      ciwatch.conf.sample
  2. 2
    0
      ciwatch/config.py
  3. 1
    1
      ciwatch/log.py

+ 3
- 0
ciwatch.conf.sample View File

@@ -8,6 +8,9 @@ gerrit_port = 29418
8 8
 debug = True
9 9
 data_dir = /var/data
10 10
 
11
+[Log]
12
+log_dir = /var/log/ciwatch
13
+
11 14
 [database]
12 15
 connection = sqlite:///:memory
13 16
 

+ 2
- 0
ciwatch/config.py View File

@@ -21,6 +21,8 @@ class Config(object):
21 21
 
22 22
     def __init__(self):
23 23
         self.cfg = self.get_config()
24
+        if not self.cfg.Log.log_dir:
25
+            self.cfg.Log.log_dir = '/var/log/ciwatch'
24 26
         if self.cfg.Data.data_dir:
25 27
             self.DATA_DIR = self.cfg.Data.data_dir
26 28
         else:

+ 1
- 1
ciwatch/log.py View File

@@ -38,4 +38,4 @@ def setup_logger(name):
38 38
     return logger
39 39
 
40 40
 
41
-logger = setup_logger(config.DATA_DIR + '/ciwatch.log')
41
+logger = setup_logger(config.cfg.Log.log_dir + '/ciwatch.log')

Loading…
Cancel
Save