码迷,mamicode.com
首页 > 其他好文 > 详细

django logging

时间:2019-04-13 19:12:54      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:max   gate   log   line   status   standard   ble   ati   nbsp   

LOG_LEVEL = ‘DEBUG‘

 

LOGGING = {

    ‘version‘ : 1,

    ‘disable_existing_loggers‘ : True,

    ‘formatters‘ : {

            ‘standard‘ : {

                ‘format‘ : ‘%(asctime)s [%(threadName)s:%(thread)d] [%(name)s:%(lineno)d] z [%(levelname)s]- %(message)s‘

            },

            ‘verbose‘ : {

                ‘format‘ : ‘[%(asctime)s] %(levelname)-6s %(name)s %(lineno)d %(threadName)s:%(thread)d %(message)s‘

            },

    },

    ‘filters‘: {

    },

 

    ‘handlers‘: {

        ‘torstatus‘: {

            ‘level‘: LOG_LEVEL,

            ‘class‘: ‘logging.handlers.RotatingFileHandler‘,

            ‘filename‘: os.path.join(BASE_DIR ,‘logs/torstatus.log‘), 

            ‘maxBytes‘: 1024*1024*5, # 5 MB

            ‘backupCount‘: 5,

            ‘formatter‘: ‘verbose‘,

        },

        

    },

    ‘loggers‘: {

        ‘torstatus‘: {

            ‘handlers‘: [‘torstatus‘],

            ‘level‘: LOG_LEVEL,

            ‘propagate‘: False

        },

    }

}

 

django logging

标签:max   gate   log   line   status   standard   ble   ati   nbsp   

原文地址:https://www.cnblogs.com/zhengze/p/10702289.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!