We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b2e2c4 commit 98fdcafCopy full SHA for 98fdcaf
config.py
@@ -46,6 +46,21 @@ class ProductionConfig(Config):
46
def init_app(cls, app):
47
Config.init_app(app)
48
49
+ import logging
50
+ from logging.handlers import RotatingFileHandler
51
+ file_handler = RotatingFileHandler('/devdmp/log/devdmp.log',
52
+ mode='w', maxBytes=1024 * 1024 * 100,
53
+ backupCount=20,
54
+ encoding="utf-8")
55
+ file_handler.setLevel(logging.WARNING)
56
+ app.logger.addHandler(file_handler)
57
+
58
+ from logging import Formatter
59
+ file_handler.setFormatter(Formatter(
60
+ '%(asctime)s %(levelname)s: %(message)s '
61
+ '[in %(pathname)s:%(lineno)d]'
62
+ ))
63
64
# email errors to the administrators
65
import logging
66
from logging.handlers import SMTPHandler
0 commit comments