php-tmdb/laravel

Level is not defined in Logger.php

rifats opened this issue · 8 comments

Hello!
There is an error after updating:
InvalidArgumentException in Logger.php line 461: Level "" is not defined, use one of: 100, 200, 250, 300, 400, 500, 550, 600

in Logger.php line 461
at Logger::getLevelName(null) in Logger.php line 292
at Logger->addRecord(null, 'pc wtfzdotnet/php-tmdb-api (v2.1.4) - [08/Nov/2016:13:45:53 +0000] "GET /3/configuration?api_key=xxxxxx HTTP/1.1" NULL NULL', array('request' => object(Request), 'response' => null, 'reason' => null)) in Logger.php line 517
at Logger->log(null, 'pc wtfzdotnet/php-tmdb-api (v2.1.4) - [08/Nov/2016:13:45:53 +0000] "GET /3/configuration?api_key=xxxxxx HTTP/1.1" NULL NULL', array('request' => object(Request), 'response' => null, 'reason' => null)) in Logger.php line 137

There is a line in config/app.php:
'log_level' => env('APP_LOG_LEVEL', 'debug'),

Fatih90, hi!
The same version - 5.3.22. Two month ago I updated from 5.2 by following the guide https://laravel.com/docs/5.3/upgrade
Maybe something missed. I'll check again.

Do you think you two can figure out what's wrong and make a pull request? Though I'm the maintainer of this package I'm not using it so debugging is difficult / would take quite some time.


What's the value of your APP_LOG_LEVEL entry in your .env file?

APP_LOG_LEVEL=debug
I must first check the upgrade process. Maybe it's my fault.

@fatih90 it is Tmdb\Helper\ImageHelper
In controller's __construct

    function __construct(MovieRepository $movieRepository,
                         MovieEntityManager $movieEntityManager,
                         CreditEntityManager $creditEntityManager,
                         MovieCreditManager $movieCreditManager,
                         ImageHelper $helper,
                         UpdateChecker $updateChecker)
    {
        $this->movieRepository      = $movieRepository;
        $this->movieEntityManager   = $movieEntityManager;
        $this->creditEntityManager  = $creditEntityManager;
        $this->movieCreditManager   = $movieCreditManager;
        $this->helper               = $helper;
        $this->updateChecker        = $updateChecker;
    }

or in blade:

@inject('image', 'Tmdb\Helper\ImageHelper')

I created a new project, a test controller for tmdb - works fine. So it must be some mistake of upgrade process. I'll copy the files of my project to the new one. @fatih90 thank you for participating.

@fatih90, hi!
Do you have log enabled in config/tmdb.php?

@okaufmann Yes, I followed up this line, but do not know how to solve issue.
I created a new project, and after the installation all dependencies, the error occurs again. So I went back to the old and disabled logging to continue working.