fix: crash when using the logger outside of the a request context v2 by lobre · Pull Request #2089 · php/frankenphp

@lobre

Fixes: #2083

It has been attempted already in #2087, but it was not enough to avoid the panic.

@lobre

@lobre lobre changed the title fix: crash when using the logger outside of the a request context fix: crash when using the logger outside of the a request context v2

Dec 19, 2025

AlliBalliBaba

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it even possible to have a context in the contextHolder without having a frankenphpContext? If not, I'd still prefer having the context inside of the frankenphpContext and removing the contextHolder to make this less confusing (not necessarily in this PR).

dunglas

@dunglas

@AlliBalliBaba not it's not, but this would create a circular reference.