Split log into frontend and backend log.
This commit is contained in:
parent
668157c552
commit
5535d3535f
|
@ -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)
|
||||
|
||||
|
|
10
config.py
10
config.py
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue