Skip to content

Commit

Permalink
#182: Add log location configuration option
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Nov 5, 2020
1 parent 836bf51 commit b56c4e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions datagateway_api/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit b56c4e7

Please sign in to comment.