Skip to content

context missing after migrating to laravel 12 #1010

@mihaileu

Description

@mihaileu

Octane Version

2.8.1

Laravel Version

12.1.1

PHP Version

8.4.3

What server type are you using?

Swoole

Server Version

6.0.1

Database Driver & Version

No response

Description

Context get lost when logging multiple times.
Seems somehow related with #907
I'm using a http middleware where I'm setting the context. i.e.: Context::add('correlation-id','something');
The first logs are adding the context, and after I receive logs without context.

This happens after migrating from: t

  • laravel framework v11.41.3 to v12.1.1
  • octane v2.6.1 to v2.8.1

I followed the changelog event the diff illuminate/container@v11.41.3...v12.1.1, but I didn't find anything related that might suggest this new behavior.

Steps To Reproduce

Route::name('welcome')
    ->get('/', function () {
        Context::add('x', 'y');
        \Log::info('test');
        
    });

without octane:
[2025-03-12 11:40:08] local.INFO: test {"correlationId":"c94c7651-1a34-43da-9694-2e4f404ea2c4","x":"y"}

with octane:

[2025-03-12 11:43:19] local.INFO: test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions