diff --git a/config.json.example b/config.json.example index f39c836e..c977e9b0 100644 --- a/config.json.example +++ b/config.json.example @@ -4,6 +4,7 @@ "ICAT_URL": "https://localhost.localdomain:8181", "icat_check_cert": false, "log_level": "WARN", + "log_location": "/home/user1/datagateway-api/logs.log", "debug_mode": false, "generate_swagger": false, "host": "127.0.0.1", diff --git a/datagateway_api/common/config.py b/datagateway_api/common/config.py index 0425ef98..298fcadf 100644 --- a/datagateway_api/common/config.py +++ b/datagateway_api/common/config.py @@ -46,6 +46,12 @@ def get_log_level(self): except KeyError: sys.exit("Missing config value, log_level") + def get_log_location(self): + try: + return self.config["log_location"] + except KeyError: + sys.exit("Missing config value, log_location") + def is_debug_mode(self): try: return self.config["debug_mode"]