diff options
author | Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com> | 2018-05-07 15:17:21 +0200 |
---|---|---|
committer | Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com> | 2018-05-07 15:17:21 +0200 |
commit | c1e5aafd5b5984b995d3ac6c74703e6a8be6e38b (patch) | |
tree | 021a7ba48aa5ac71276ce24e08fea7c183bd9a2a | |
parent | 705e5cbf70c5937a841b58fc484ce0ee2e51a351 (diff) |
create log file during logger initialization
Currently the log messages from utils and openstack_utils
python modules are not logged into bgpvpn.log. This is
because this file is created during SDNVPN Feature
initialization. So creating this file during logger
initialization itself.
Change-Id: I538acdfb2119f1eaa562f61dac3b6bf7c3a58e41
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
-rw-r--r-- | sdnvpn/lib/logutil.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sdnvpn/lib/logutil.py b/sdnvpn/lib/logutil.py index 3710ca1..78f6e96 100644 --- a/sdnvpn/lib/logutil.py +++ b/sdnvpn/lib/logutil.py @@ -8,7 +8,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 # import logging -import os.path from xtesting.core import feature @@ -16,8 +15,6 @@ from xtesting.core import feature def getLogger(module_name): logger = logging.getLogger(module_name) log_file = "{}/{}.log".format("/var/lib/xtesting/results", "bgpvpn") - if os.path.exists(log_file): - feature.Feature.configure_logger(logger, log_file) - else: - logger.setLevel(logging.DEBUG) + open(log_file, 'w+') + feature.Feature.configure_logger(logger, log_file) return logger |