django+python本地日志log源码
来源:互联网 发布:java关键字false 编辑:程序博客网 时间:2024/06/18 17:11
def get_logger_local(logname,modlename):
root_logger = logging.getLogger(logname)
if len(root_logger.handlers)==0:
path=os.path.join(sys.path[0],'logs/').replace('\\','/')
if not os.path.isdir(path):
os.mkdir(path)
logFile=path+logname+'.log'
handler=logging.handlers.RotatingFileHandler(logFile,mode='a',
maxBytes=1024*1024*10,backupCount=10,encoding="utf-8")
#handler.setLevel(logging.INFO)
fmter=logging.Formatter(LOGGING_MSG_FORMAT,LOGGING_DATE_FORMAT)
handler.setFormatter(fmter)
root_logger.addHandler(handler)
root_logger.setLevel(logging.DEBUG)
logname='%s.%s' % (logname,modlename)
return logging.getLogger(logname)
root_logger = logging.getLogger(logname)
if len(root_logger.handlers)==0:
path=os.path.join(sys.path[0],'logs/').replace('\\','/')
if not os.path.isdir(path):
os.mkdir(path)
logFile=path+logname+'.log'
handler=logging.handlers.RotatingFileHandler(logFile,mode='a',
maxBytes=1024*1024*10,backupCount=10,encoding="utf-8")
#handler.setLevel(logging.INFO)
fmter=logging.Formatter(LOGGING_MSG_FORMAT,LOGGING_DATE_FORMAT)
handler.setFormatter(fmter)
root_logger.addHandler(handler)
root_logger.setLevel(logging.DEBUG)
logname='%s.%s' % (logname,modlename)
return logging.getLogger(logname)
0 0
- django+python本地日志log源码
- django+python缓存本地cache源码
- python log 日志记录
- python实现log日志
- 使用twisted.python.log日志
- python——log日志
- boost log 写不进本地的日志文件
- 错误收集(本地Log日志)错误上传
- android:Log日志保存到本地
- 打印log日志,保存在本地
- Django+python 日志文件配置
- python保存log日志,并利用log日志来画图
- python logging (python log 日志详细)
- python中log日志的使用
- Python+Django+SAE系列教程6-----本地配置Django
- python、django的日志与调试功能
- django数据库本地配置/python读取本地配置文件
- android log 的工具类 ,把日志保存到本地
- 从零开始—我的开源项目5:代码完善(中)
- 如何删除适用于Firefox的 .NET Framework Assistant
- android-Service和Thread的区别
- Json字符串 与 java对象
- iOS的主要框架介绍
- django+python本地日志log源码
- json数据解析
- 未来的购物,智能商店时代来临
- 1006. 换个格式输出整数 (15)
- Tomcat调优总结
- SAP MM和SD中的条件表
- linux用户态和内核态理解
- IE对input元素的onchange 的不支持解决办法
- win8安装.NETFramework35的问题