diff --git a/webapp/config.py.template b/webapp/config.py.template index d29d92b..9e3b74c 100644 --- a/webapp/config.py.template +++ b/webapp/config.py.template @@ -13,10 +13,15 @@ 3/28/23 """ import logging +import pathlib class Config: + # Logging + LOG_PATH = pathlib.Path('/var/log/pasta') + LOG_LEVEL = logging.WARN + # PASTA+ authentication token attributes PUBLIC = "public" SYSTEM = "https://pasta.edirepository.org/authentication" @@ -41,8 +46,5 @@ class Config: # Static directory path STATIC = "/static" - # Logging level - LEVEL = logging.INFO - # Proxy timeout (seconds) TIMEOUT = 120.0 diff --git a/webapp/main.py b/webapp/main.py index 77fccf7..3afb83e 100644 --- a/webapp/main.py +++ b/webapp/main.py @@ -25,10 +25,9 @@ from filter import audit from views import index -cwd = os.path.dirname(os.path.realpath(__file__)) -logfile = cwd + "/gatekeeper.log" -daiquiri.setup(level=Config.LEVEL, - outputs=(daiquiri.output.File(logfile), "stdout",)) + +daiquiri.setup(level=Config.LOG_LEVEL, + outputs=(daiquiri.output.File(Config.LOG_PATH), "stdout",)) logger = daiquiri.getLogger(__name__)