freshbitsweb / laravel-log-enhancer Goto Github PK
View Code? Open in Web Editor NEWMake debugging easier by adding more data to your laravel logs (Laravel 5.6+)
License: MIT License
Make debugging easier by adding more data to your laravel logs (Laravel 5.6+)
License: MIT License
We get the exception (full stack trace below) when trying to log exceptions in a Laravel 7.18.0 project, using v1.2.0 of this package.
Here's our config/logging.php
:
// ...
'channels' => [
'stack' => [
'driver' => 'stack',
'tap' => [Freshbitsweb\LaravelLogEnhancer\LogEnhancer::class],
'channels' => ['single','bugsnag','papertrail'],
'ignore_exceptions' => false,
],
// ...
And our config/laravel_log_enhancer.php
:
<?php
return [
'log_request_details' => true,
'log_input_data' => true,
'log_request_headers' => true,
'log_session_data' => true,
'log_memory_usage' => true,
'log_git_data' => false,
// You can specify the inputs from the user that should not be logged
'ignore_input_fields' => ['password', 'confirm_password', 'password_confirmation'],
];
[2020-07-10 04:02:45] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (Error(code: 0): Call to undefined method Monolog\\Handler\\PsrHandler::pushProcessor() at /home/forge/project.com/releases/20200710025358/vendor/freshbitsweb/laravel-log-enhancer/src/LogEnhancer.php:21)
[stacktrace]
#0 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(142): Freshbitsweb\\LaravelLogEnhancer\\LogEnhancer->__invoke()
#1 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(119): Illuminate\\Log\\LogManager->tap()
#2 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Support/helpers.php(558): Illuminate\\Log\\LogManager->Illuminate\\Log\\{closure}()
#3 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(120): with()
#4 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(98): Illuminate\\Log\\LogManager->get()
#5 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(547): Illuminate\\Log\\LogManager->driver()
#6 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(122): Illuminate\\Log\\LogManager->error()
#7 /home/forge/project.com/releases/20200710025358/app/Exceptions/Handler.php(39): Illuminate\\Foundation\\Exceptions\\Handler->report()
#8 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(49): App\\Exceptions\\Handler->report()
#9 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Routing\\Pipeline->handleException()
#10 /home/forge/project.com/releases/20200710025358/vendor/darkghosthunter/laraguard/src/Http/Middleware/ConfirmTwoFactorCode.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#11 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): DarkGhostHunter\\Laraguard\\Http\\Middleware\\ConfirmTwoFactorCode->handle()
#12 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#14 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#15 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Auth\\Middleware\\Authenticate->handle()
#16 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(76): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#18 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#20 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#21 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#22 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle()
#23 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#25 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#27 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Routing/Router.php(687): Illuminate\\Pipeline\\Pipeline->then()
#29 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRouteWithinStack()
#30 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Routing/Router.php(628): Illuminate\\Routing\\Router->runRoute()
#31 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Routing/Router.php(617): Illuminate\\Routing\\Router->dispatchToRoute()
#32 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Routing\\Router->dispatch()
#33 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#34 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#35 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#36 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#38 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#40 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle()
#42 /home/forge/project.com/releases/20200710025358/vendor/fruitcake/laravel-cors/src/HandleCors.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle()
#44 /home/forge/project.com/releases/20200710025358/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle()
#46 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(140): Illuminate\\Pipeline\\Pipeline->then()
#48 /home/forge/project.com/releases/20200710025358/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(109): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#49 /home/forge/project.com/releases/20200710025358/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle()
#50 {main}
"}
When I comment out 'tap' => [Freshbitsweb\LaravelLogEnhancer\LogEnhancer::class],
from our config, the issue resolves.
Any idea what could be going on here?
Thank you.
Are you planning to support Laravel 10?
Hi,
When I upgrade Laravel to 5.7 from 5.6, I got this :
Class session does not exist
and It thrown by RequestDataProcessor
class, when want to access session() helper.
my solution was disable log_session_data
in config file, run the application, enable it again.
Hey @gauravmak
I have followed your guide on https://laravelfactory.com/blog/step-by-step-guide-to-laravel-package-development especially for testing of laravel packages and tried to incooperate it with one of my packages.
https://github.com/herpaderpaldent/seat-groups/blob/tests/composer.json
Although i have pretty much copy cat you, when i try to run sh vendor/bin/phpunit vendor/herpaderpaldent/seat-groups
i get the following error:
Fatal error: Class 'Herpaderpaldent\Seat\SeatGroups\Tests\TestCase' not found in /var/www/seat/vendor/herpaderpaldent/seat-groups/tests/SeatGroupIndexTest.php on line 9
It looks for me like some Namespace issues? Any tips?
Hello!
I am just wondering if it is possible to provide support for Laravel 5.5 as it is an LTS version.
Maybe it is just a matter of change the composer.json requirements, but maybe there is an internal dependency on the code.
Thanks :)
5.5 is the latest LTS, should be supported.
Hi,
could you please support PHP8? It's probably as easy as adding | ^8.0
in the composer.json
Thanks!
Could you update the package for 5.7? We already updated and would like to have it back ;-)
Hey, Is it possible to specify the slack channel?
It would be great if if works on Lumen - fantastic in fact. If some additional steps are needed (for example, loading the provider), they should be documented. If it is not supported at all, then that should probably also be documented also.
Let me know if I can help.
不适配 "monolog/monolog": "1.24.*" 版本
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.