找不到Laravel 5类日志 [英] Laravel 5 Class Log Could not be Found

查看:148
本文介绍了找不到Laravel 5类日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Laravel 5中弯腰,而且由于缺乏自动加载功能,事实证明这是个麻烦.我遇到了最奇怪的错误.我无法在本地主机上记录任何内容.如果是PHP错误,则记录的很好,但是如果我尝试写入日志,则会引发错误.这是Windows,因此没有文件权限"错误.这是我得到的错误:

I am elbows deep in Laravel 5 and it's proving to be quite the bugger with the lack of autoloading. I am running into the weirdest of errors. I can't Log anything on my localhost. If it's a PHP error, it logs just fine, but if I try to write to the log, it throws an error. It's a Windows so no File Permission errors. Here's the error I get:

[2015-02-11 20:09:40] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Http\Controllers\Log' not found' in C:\xampp\htdocs\bg_checks\laravel\app\Http\Controllers\BgInfoController.php:44
Stack trace:
#0 C:\xampp\htdocs\bg_checks\laravel\storage\framework\compiled.php(1721): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError(Array)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()

Laravel 5仍然很新,因此没有很多信息.我试图找到一些东西,只能在Laracast的论坛上找到一个论坛,但他们建议的工作都没有.

Laravel 5 is still pretty new so there's not a lot of info on it. I've tried to find something and can only find a forum on Laracast's forum and nothing they suggested worked.

帮助!

推荐答案

我认为您在App\Http\Controllers目录中没有Log类文件.因此,您必须添加

I don't think you have a Log class file in App\Http\Controllers directory. So you must add

use Log;

如果您使用Laravel的记录器,或者

if you are using Laravel's logger, or

use Path\To\Your\Log;

用于自定义记录器.

这篇关于找不到Laravel 5类日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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