Log [] is not defined. Unable to create configured logger. Using emergency logger.
- LogViewer Version: 4.5
- Laravel Version: 5.6.3
- PHP Version: 7.1.3
Description:
Hi,
I did all the steps needed to install and use logviewer but when I go to http://{myproject}/log-viewer what I get is an error
laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at /var/www/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:181)
[stacktrace]
#0 /var/www/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(115): Illuminate\\Log\\LogManager->resolve(NULL)
#1 /var/www/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(103): Illuminate\\Log\\LogManager->get(NULL)
#2 /var/www/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(572): Illuminate\\Log\\LogManager->driver()
#3 /var/www/vendor/barryvdh/laravel-debugbar/src/LaravelDebugbar.php(270): Illuminate\\Log\\LogManager->__call('listen', Array)
#4 /var/www/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(61): Barryvdh\\Debugbar\\LaravelDebugbar->boot()
#5 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#6 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#7 /var/www/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#8 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#9 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#10 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#11 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#12 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#13 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#14 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#15 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#16 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#17 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#18 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#19 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#20 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#21 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#22 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#23 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#24 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#25 /var/www/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#26 {main}
"}
My question is, is it not supported for Laravel Version: 5.6.3 ? I added APP_LOG=daily LOG_CHANNEL=daily in my .env file and Arcanedev\LogViewer\LogViewerServiceProvider::class on my app.php service provider section.
Thank you for your time.
I think your issue is unrelated to this package.
You can be sure it works by creating a fresh project and installing only the logviewer package.
If you get the same issue, please describe it with steps to reproduce it.
Thanks for using this package :+1:
Try to update your laravel project to 5.6.4 and see if it solves your issue.
No, I'm afraid it doesn't. When I run php artisan log-viewer:check I still get these errors, although I updated my .env file to daily mode.
| Application requirements | | Status | Message |
| failed | You should set the log handler to daily mode. Please check the LogViewer wiki page (Requirements) for more details. |
| LogViewer messages |
| File | Message |
| laravel.log | You have a single log file in your application, you should split the [laravel.log] into seperate log files. |
OK, i see the issue.
You're not using the daily channel for your log system.
Edit the .env file: LOG_CHANNEL=daily
You can delete the single log file because it's not supported by the package: storage/log/laravel.log
Check my comment for more details about the usage: https://github.com/ARCANEDEV/LogViewer/issues/195#issuecomment-367388830
I had that LOG_CHANNEL=daily on my .env file but still.. Should that be defined on my config/app.php file too?
If you're using Laravel 5.6, you need to update your config files if you've migrated from an older laravel version.
With laravel 5.6, the logging system has a dedicated file now: https://github.com/laravel/laravel/blob/master/config/logging.php
Just the .env file will do the job.
That was the issue. Thank you.
You're welcome. Thanks for using the package :+1:
I had the same issue with the error in my laravel.log file. And the adding logging.php config fixed it. But I still have a question. I developed my Laravel app from scratch and it based on Laravel 5.6.5. And I didn't have this config file in my file structure until I had added it manually... Why??? When did this file apper in Laravel app's file structure?
Hi @Pashaster12,
the official documentation may helps you to see all the major changes made from laravel 5.5 to 5.6.
If you've any laravel related questions, ask the forums [Laracasts] !!
If you're using Laravel 5.6, you need to update your config files if you've migrated from an older laravel version.
With laravel 5.6, the logging system has a dedicated file now: https://github.com/laravel/laravel/blob/master/config/logging.php
Just the
.envfile will do the job.
That worked for me as soon as I copied the loggin.php file in the config directory. I recently did a compooser update
I copied the loggin.php file in the config directory. now, it's work.
@arcanedev-maroc, work for me. Thanks. I have been update from Laravel 5.4. to 5.8
Solution:
cd config && wget https://raw.githubusercontent.com/laravel/laravel/master/config/logging.php
I copied the loggin.php file in the config directory. now, it's work.