|
@@ -168,32 +168,86 @@ ADMINS = ["{{ mail_admin_address }}"]
|
|
# If set to a file path, this should be an absolute file path
|
|
# If set to a file path, this should be an absolute file path
|
|
LOG_CONF_FILE = {{ log_config_path or None }}
|
|
LOG_CONF_FILE = {{ log_config_path or None }}
|
|
|
|
|
|
|
|
+# Path to store the INFO and ERROR logs
|
|
|
|
+# If None this defaults to flaskbb/logs
|
|
|
|
+#
|
|
|
|
+# If set to a file path, this should be an absolute path
|
|
|
|
+LOG_PATH = os.path.join(basedir, 'logs')
|
|
|
|
+
|
|
|
|
+# The default logging configuration that will be used when
|
|
|
|
+# USE_DEFAULT_LOGGING is set to True
|
|
|
|
+LOG_DEFAULT_CONF = {
|
|
|
|
+ 'version': 1,
|
|
|
|
+ 'disable_existing_loggers': False,
|
|
|
|
+
|
|
|
|
+ 'formatters': {
|
|
|
|
+ 'standard': {
|
|
|
|
+ 'format': '%(asctime)s %(levelname)-7s %(name)-25s %(message)s'
|
|
|
|
+ },
|
|
|
|
+ 'advanced': {
|
|
|
|
+ 'format': '%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ 'handlers': {
|
|
|
|
+ 'console': {
|
|
|
|
+ 'level': 'NOTSET',
|
|
|
|
+ 'formatter': 'standard',
|
|
|
|
+ 'class': 'logging.StreamHandler',
|
|
|
|
+ },
|
|
|
|
+ 'flaskbb': {
|
|
|
|
+ 'level': 'DEBUG',
|
|
|
|
+ 'formatter': 'standard',
|
|
|
|
+ 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
|
+ 'filename': os.path.join(LOG_PATH, 'flaskbb.log'),
|
|
|
|
+ 'mode': 'a',
|
|
|
|
+ 'maxBytes': 10485760, # 10MB
|
|
|
|
+ 'backupCount': 5,
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ 'infolog': {
|
|
|
|
+ 'level': 'INFO',
|
|
|
|
+ 'formatter': 'standard',
|
|
|
|
+ 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
|
+ 'filename': os.path.join(LOG_PATH, 'info.log'),
|
|
|
|
+ 'mode': 'a',
|
|
|
|
+ 'maxBytes': 10485760, # 10MB
|
|
|
|
+ 'backupCount': 5,
|
|
|
|
+ },
|
|
|
|
+ 'errorlog': {
|
|
|
|
+ 'level': 'ERROR',
|
|
|
|
+ 'formatter': 'standard',
|
|
|
|
+ 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
|
+ 'filename': os.path.join(LOG_PATH, 'error.log'),
|
|
|
|
+ 'mode': 'a',
|
|
|
|
+ 'maxBytes': 10485760, # 10MB
|
|
|
|
+ 'backupCount': 5,
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ 'loggers': {
|
|
|
|
+ 'flask.app': {
|
|
|
|
+ 'handlers': ['infolog', 'errorlog'],
|
|
|
|
+ 'level': 'INFO',
|
|
|
|
+ 'propagate': True
|
|
|
|
+ },
|
|
|
|
+ 'flaskbb': {
|
|
|
|
+ 'handlers': ['console', 'flaskbb'],
|
|
|
|
+ 'level': 'WARNING',
|
|
|
|
+ 'propagate': True
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
# When set to True this will enable the default
|
|
# When set to True this will enable the default
|
|
# FlaskBB logging configuration which uses the settings
|
|
# FlaskBB logging configuration which uses the settings
|
|
# below to determine logging
|
|
# below to determine logging
|
|
USE_DEFAULT_LOGGING = True
|
|
USE_DEFAULT_LOGGING = True
|
|
|
|
|
|
-# Log format FlaskBB will use
|
|
|
|
-LOG_FORMAT = '%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'
|
|
|
|
-
|
|
|
|
-# Log level FlaskBB will use
|
|
|
|
-LOG_LEVEL = "INFO"
|
|
|
|
-
|
|
|
|
# If SEND_LOGS is set to True, the admins (see the mail configuration) will
|
|
# If SEND_LOGS is set to True, the admins (see the mail configuration) will
|
|
# recieve the error logs per email.
|
|
# recieve the error logs per email.
|
|
SEND_LOGS = False
|
|
SEND_LOGS = False
|
|
|
|
|
|
-# Path to store the INFO and ERROR logs
|
|
|
|
-# If None this defaults to flaskbb/logs
|
|
|
|
-#
|
|
|
|
-# If set to a file path, this should be an absolute path
|
|
|
|
-LOG_PATH = None
|
|
|
|
-
|
|
|
|
-# The filename for the info and error logs. The logfiles are stored
|
|
|
|
-# at the path specified in LOG_PATH
|
|
|
|
-INFO_LOG = "info.log"
|
|
|
|
-ERROR_LOG = "error.log"
|
|
|
|
-
|
|
|
|
|
|
|
|
# FlaskBB Settings
|
|
# FlaskBB Settings
|
|
# ------------------------------ #
|
|
# ------------------------------ #
|