如何在终端(cli)中显示admin / reports / dblog


14

在开发过程中,我真的很喜欢一个包含所有drupal日志消息的专用屏幕。在mac或* nix上工作,创建一个新的终端窗口并在日志文件上执行tail -f会非常好。因此,我可以在apache error.log上执行尾号-f,但我想显示admin / reports / dblog中显示的drupal日志,在哪里可以找到它,或者是否可以将其输出到终端屏幕,以及如果是这样怎么办?


@dinesh感谢您的标签!那是我将创建的确切标签,但缺少19个代表;)
FLY 2012年

Answers:


29

您可以使用drush执行此操作:

$ drush help | grep watchdog
 watchdog-delete       Delete watchdog messages.
 watchdog-list         Show available message types and severity levels. A
 (wd-list)             prompt will ask for a choice to show watchdog messages.
 watchdog-show         Show watchdog messages.

drush watchdog-show 这里有太多选项无法完整显示,但这些是示例:

 drush watchdog-show                       Show a listing of most recent 10
                                           messages.
 drush watchdog-show 64                    Show in detail message with id 64.
 drush watchdog-show "cron run succesful"  Show a listing of most recent 10
                                           messages containing the string "cron
                                           run succesful".
 drush watchdog-show --count=46            Show a listing of most recent 46
                                           messages.
 drush watchdog-show --severity=notice     Show a listing of most recent 10
                                           messages with a severity of notice.
 drush watchdog-show --type=php            Show a listing of most recent 10
                                           messages of type php.
 drush watchdog-show --tail --full         Show a listing of most recent 10
                                           messages with extended information
                                           about each one and continue showing
                                           messages as they are registered in
                                           the watchdog.
 drush watchdog-show --tail                Do a tail of the watchdog with a
 --sleep-delay=2                           delay of two seconds between each
                                           poll to the database.

4
谢谢drush watchdog-show --tail --full --count=50,我现在正在使用的是:)
FLY 2012年

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.