生产服务器上的Django打印信息 [英] django print information on production server

查看:1681
本文介绍了生产服务器上的Django打印信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的目的,调试应用程序的一些版画。在那里,这些印刷资料去生产服务器?在Apache日志?我使用的Apache / mod_wsgi的。

I have some prints on my application for debug purpose. On the production server where these printed information goes? on apache log? I am using apache/mod_wsgi .

感谢。

推荐答案

使用记录

我喜欢在登录多次文件,所以我用我的settings.py以下

I like to log to file at times so I use the following in my settings.py

import logging


logging.basicConfig(
    level = logging.INFO,
    format = '%(asctime)s %(levelname)s %(message)s',
    filename = '/tmp/djangoLog.log',)

和我想要的日志:

import logging

logging.info("Making the alpha-ldap connection");

然后/tmp/djangoLog.log我看行使α-LDAP连接的e

then in /tmp/djangoLog.log I would see the line "Making the alpha-ldap connection"e

这篇关于生产服务器上的Django打印信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆