diff --git a/config.py b/config.py index bc7baaf..02ef632 100755 --- a/config.py +++ b/config.py @@ -54,6 +54,12 @@ def load_env(): except KeyError: pass + try: + if os.environ['LOG_PATH'] != "": + configdict['log']['log_path'] = os.environ['LOG_PATH'] + except KeyError: + pass + return configdict diff --git a/config.toml.example b/config.toml.example index eb519db..35c6316 100644 --- a/config.toml.example +++ b/config.toml.example @@ -14,3 +14,6 @@ mbox_user = "root" [database] db_path = "/var/ticketfrei/db.sqlite" + +[log] +log_path = "/var/ticketfrei/error.log" diff --git a/frontend.py b/frontend.py index 38354a6..7d7a539 100755 --- a/frontend.py +++ b/frontend.py @@ -265,7 +265,7 @@ def login_mastodon(user): logger = logging.getLogger() -fh = logging.FileHandler('/var/log/ticketfrei/error.log') +fh = logging.FileHandler(config['log']['log_path']) fh.setLevel(logging.DEBUG) logger.addHandler(fh) @@ -273,6 +273,6 @@ application = bottle.default_app() bottle.install(SessionPlugin('/')) if __name__ == '__main__': - bottle.run(host="0.0.0.0", port=config["web"]["port"]) + bottle.run(host=config["web"]["host"], port=config["web"]["port"]) else: application.catchall = False