Split log into frontend and backend log.

This commit is contained in:
cookietime--yay 2019-03-04 14:39:09 +01:00
parent 668157c552
commit 5535d3535f
4 changed files with 12 additions and 5 deletions

View file

@ -17,7 +17,7 @@ def shutdown():
if __name__ == '__main__':
logger = logging.getLogger()
fh = logging.FileHandler('/var/log/ticketfrei/backend.log')
fh = logging.FileHandler(config["log"]["log_backend"])
fh.setLevel(logging.DEBUG)
logger.addHandler(fh)

View file

@ -55,8 +55,14 @@ def load_env():
pass
try:
if os.environ['LOG_PATH'] != "":
configdict['log']['log_path'] = os.environ['LOG_PATH']
if os.environ['LOG_FRONTEND'] != "":
configdict['log']['log_frontend'] = os.environ['LOG_FRONTEND']
except KeyError:
pass
try:
if os.environ['LOG_BACKEND'] != "":
configdict['log']['log_backend'] = os.environ['LOG_BACKEND']
except KeyError:
pass

View file

@ -16,4 +16,5 @@ mbox_user = "root"
db_path = "/var/ticketfrei/db.sqlite"
[log]
log_path = "/var/ticketfrei/error.log"
log_frontend = "/var/ticketfrei/frontend.log"
log_backend = "/var/log/ticketfrei/backend.log"

View file

@ -265,7 +265,7 @@ def login_mastodon(user):
logger = logging.getLogger()
fh = logging.FileHandler(config['log']['log_path'])
fh = logging.FileHandler(config['log']['log_frontend'])
fh.setLevel(logging.DEBUG)
logger.addHandler(fh)