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

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

问题描述

如何查看 Drupal 日志文件?

How can I check Drupal log files?

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

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

推荐答案

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

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.

使用watchdog() 函数从您自己的自定义模块向此日志添加条目.

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

当 Drupal 引导时,它使用 PHP 函数 set_error_handler() 为 PHP 错误设置自己的错误处理程序.因此,每当 Drupal 中发生 PHP 错误时,都会通过 admin/reports/dblog 中的 watchdog() 调用记录下来.如果您查找 PHP 致命错误,例如,在 /var/log/apache/error.log 中但没有看到它们,这就是原因.其他错误,例如Apache 错误仍应记录在 /var/log 中,或您将其配置为记录到的任何位置.

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天全站免登陆