如何检查Drupal日志文件? [英] How can I check Drupal log files?

查看:108
本文介绍了如何检查Drupal日志文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何检查Drupal日志文件?



我使用的是Ubuntu 10.10 + Apache2 + PHP 5.33 + MySQL和Drupal 7.

解决方案

要查看Drupal自己的内部日志系统( watchdog 数据库表)中的条目,请转到< a href =http://example.com/admin/reports/dblog> http://example.com/admin/reports/dblog 。这些可能包括Drupal特定的错误以及抛出的一般PHP或MySQL错误。



使用 watchdog() 功能从您自己的日志中添加一个条目定制模块。



当Drupal引导时,它使用PHP函数 set_error_handler()为PHP设置自己的错误处理程序错误。因此,每当Drupal内发生PHP错误时,将通过 watchdog()调用 admin / reports / dblog 。如果您在寻找PHP致命错误,例如,在 /var/log/apache/error.log 中,看不到它们,这就是为什么。其他错误,例如Apache错误,仍然应该记录在 / var / log 中,或者您配置为登录的地方。


How can I check Drupal log files?

I'm using Ubuntu 10.10 + Apache2 + PHP 5.33 + MySQL and Drupal 7.

解决方案

To view entries in Drupal's own internal log system (the watchdog database table), go to http://example.com/admin/reports/dblog. These can include Drupal-specific errors as well as general PHP or MySQL errors that have been thrown.

Use the watchdog() function to add an entry to this log from your own custom module.

When Drupal bootstraps it uses the PHP function set_error_handler() to set its own error handler for PHP errors. Therefore, whenever a PHP error occurs within Drupal it will be logged through the watchdog() call at admin/reports/dblog. If you look for PHP fatal errors, for example, in /var/log/apache/error.log and don't see them, this is why. Other errors, e.g. Apache errors, should still be logged in /var/log, or wherever you have it configured to log to.

这篇关于如何检查Drupal日志文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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