-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context gets cleared before logging #907
Comments
🤔️ Maybe in octane you need to use |
@sy-records Yeah that works! |
Thanks @sy-records |
@driesvints I didn't close this issue on purpose, because that is a workaround and not a solution/fix. In this case I really needed it for logging purpose, but I will also need Context as a data storing mechanism for different parts of application. It's still going to be cleared before getting to logs. So I would really suggest to debug why it's being cleared by Octane. |
@Lotuashvili ah gotcha. I thought you were happy with the workaround. I'll try to see if this one is solvable. |
Thanks for reporting this one. I've opened a PR to fix this issue: #910 |
Octane Version
2.3.7
Laravel Version
11.10
PHP Version
8.3
What server type are you using?
Swoole
Server Version
AWS
Database Driver & Version
MySQL 8
Description
While using Laravel Octane and Context variables, it gets cleared before the log entry is created. I can successfully access my data by
Context::get('name')
in the app, but it's not being included in logs.I tried to run this application without Octane (
php artisan serve
), and the context is working as expected.Steps To Reproduce
Create a test route in
web.php
: (As shown here)In
laravel.log
file, you will get onlylocal_data
.The text was updated successfully, but these errors were encountered: