Profiler enabled check in DebugHandlerPass doesn't work correctly
mac-cain13 opened this issue · 7 comments
The DebugHandlerPass checks if the profiler is enabled, but I think that this check is incomplete. I'm running a Symfony 2.2 instance and even in production mode the profiler
section is defined in the config, only the profiler.enabled
option is set to false to disable the profiler.
I think that the DebugHandlerPass
class should check if the enabled is set to true and only then add the DebugHandler
. Or is there something I'm missing?
There is another issue actually: even if it is configured as disabled by default, it can be enabled later in the request.
@fabpot what would be the right behavior here ?
I think the easiest thing to do is to additionally check for the kernel.debug
setting and registering the debug handler only if it is set to true
.
OK I now just check if the profiler will be disabled by a method call.. Which works if it's disabled even if kernel.debug is true. It means you won't get logs collected if you enable it during the request though, but I hope we can live with that. The other way would be to propagate the state of the profiler to its collectors so we could then enable/disable the logger to prevent leaking.
Great! Thanks for fixing this one. :)
@Seldaek 2.3 can now remove the profiler properly instead of just defaulting to disable it. So this workaround code should probably be removed for 2.3 to allow collecting logs properly when enabling the profiler selectively
Alright, reopening so it doesn't get lost.