log python errors to extra file
This commit is contained in:
parent
d280130b29
commit
27497e7129
|
@ -10,7 +10,7 @@ import time
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
fh = logging.StreamHandler()
|
fh = logging.FileHandler('/var/log/ticketfrei/error.log')
|
||||||
fh.setLevel(logging.DEBUG)
|
fh.setLevel(logging.DEBUG)
|
||||||
logger.addHandler(fh)
|
logger.addHandler(fh)
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ def login_mastodon(user):
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
fh = logging.StreamHandler()
|
fh = logging.FileHandler('/var/log/ticketfrei/error.log')
|
||||||
fh.setLevel(logging.DEBUG)
|
fh.setLevel(logging.DEBUG)
|
||||||
logger.addHandler(fh)
|
logger.addHandler(fh)
|
||||||
|
|
||||||
|
@ -169,4 +169,7 @@ bottle.install(SessionPlugin('/'))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# testing only
|
# testing only
|
||||||
bottle.run(host='localhost', port=8080)
|
try:
|
||||||
|
bottle.run(host='localhost', port=8080)
|
||||||
|
except Exception:
|
||||||
|
logger.error('Unspecified Error.', exc_info=True)
|
||||||
|
|
Loading…
Reference in a new issue