【问题标题】:Laravel 5 not creating logsLaravel 5 不创建日志
【发布时间】:2015-08-08 14:22:52
【问题描述】:

我开始使用 Laravel 5,使用 Homestead/Vagrant 作为服务器,使用 Putty 进行 SSH 连接。

我正在构建我的第一个站点,但它没有在/storage/logs 创建一个日志。它也没有显示错误。我在/storage 目录上运行了chmod -777,所以不是这样。有什么想法吗?

更新:按照建议,我进入了 vagrant/var/hhvm/ 中的 error.log。果然,就是这样。错误是“\n致命错误:Class undefined: HTML in /home/vagrant/Code/Laravel/storage/framework/views/441aef21be6c3c32079f86e5812a9d0a on line 39"

我按照下面列出的步骤添加了课程。 http://laravelcollective.com/docs/5.0/html#installation 编辑了 composer.json,运行 composer update,添加了提供者和别名。仍然获得死亡的白屏。

现在有一个/storage/的登录,上面写着:

[2015-05-27 11:33:44] local.ERROR: exception 'InvalidArgumentException' with message 'Command "tail" is not defined.' in /home/vagrant/Code/laravel/vendor/symfony/console/Symfony/Component/Console/Application.php:549 , followed by a stack trace. This seems to be the error thrown by my attempt to run laravel tail, which I did before looking in the vagrant log. Nothing in there about why it's not loading now.

【问题讨论】:

  • 尝试运行sudo chmod -R 777 storage
  • 在 Vagrant 框中检查 /var/log/hhvm/error.log。在 Laravel 有机会捕获它们之前,一些致命错误就已经出现了。
  • 好的,有些进展。已编辑的问题。感谢您继续提供帮助,伙计们,我觉得这一切都发生了一些小事。

标签: php laravel-5


【解决方案1】:

首先,你必须在存储上做一个chmod -R 777,以保证存储中的所有文件和文件夹都是可写的。

其次,最好允许调试模式!

您也可以尝试运行artisan tail 以获取最新日志

【讨论】:

    【解决方案2】:

    正如FBidu 回答的很好,但是artisan tail 在 laravel 5 中没有附带默认包。但是可以安装 composer require spatie/laravel-tail

    在 config/app.php 中

    'providers' => [
        ...
        'Spatie\Tail\TailServiceProvider',
        ...
    ];
    

    完成后,您可以跟踪本地日志

    php artisan tail

    远程日志可以用 php artisan tail production

    Link here

    【讨论】:

      猜你喜欢
      • 2015-07-05
      • 2019-12-06
      • 2016-01-27
      • 1970-01-01
      • 2019-07-16
      • 2015-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多