mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Fix logging with rotation
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
from logging import handlers
|
||||||
import re
|
import re
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
@@ -313,6 +314,15 @@ async def get_partial():
|
|||||||
#=======================================MAIN===================================================
|
#=======================================MAIN===================================================
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.logger.setLevel(logging.DEBUG)
|
app.logger.setLevel(logging.DEBUG)
|
||||||
|
h1 = handlers.RotatingFileHandler(
|
||||||
|
filename="E:\\logs\\librarian.log",
|
||||||
|
encoding="utf-8",
|
||||||
|
mode="a",
|
||||||
|
maxBytes=6 * 1024 * 1024,
|
||||||
|
backupCount=6,
|
||||||
|
)
|
||||||
|
|
||||||
|
app.logger.addHandler(h1)
|
||||||
threads = []
|
threads = []
|
||||||
threads.append(threading.Thread(target=waitress_run))
|
threads.append(threading.Thread(target=waitress_run))
|
||||||
#threads.append(threading.Thread(target=flask_debug))
|
#threads.append(threading.Thread(target=flask_debug))
|
||||||
|
|||||||
Reference in New Issue
Block a user