4

I'm a Laravel newbie. I'm working with a package called Confide. It has an error which I'm trying to identify using the Log function. When I call the Log function I get an exception

Class 'Zizaco\Confide\Log' not found 

when I include use Illuminate\Log; I get an error message

Class 'Illuminate\Log' not found 

What am I doing wrong? I have run composer dump-auto -o but there is no change

Here is a section of my code

<?php namespace Zizaco\Confide;

use Illuminate\Log;
use Illuminate\View\Environment;
use Illuminate\Config\Repository;
use InvalidArgumentException;
use Zizaco\Confide\ObjectProvider;



class Confide
{

and the code that causes an error is:

Log::info('The value is '.$token);

3 Answers 3

8

You have to use just Log:

use Log;

Because this is not the class, but the Log Facade.

Sign up to request clarification or add additional context in comments.

Comments

2

It looks like Illuminate\Log is a namespace, not a class.

See the Laravel API here: http://laravel.com/api/namespace-Illuminate.Log.html

Laravel uses Monolog, and creates a Log facade to it. You should be able to simply use use Log;.

Comments

1

You can also try like this.

\Log::info('The value is '.$token);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.