Context bug - PCRE JIT Stack Limit issue with large JSON contexts
essell opened this issue · 2 comments
essell commented
I discovered a silent failure that causes contexts to not be parsed properly in Laravel logs. This happens particularly when you are logging request/response objects from REST APIs and the JSON gets fairly large.
The preg_last_error_msg() is "JIT stack limit"
This is due to PHP relying on the PCRE JIT library which has a stack limit, mostly due to it not using POSIX threads. The regex used to match JSON is highly recursive (and has to be, to work).
I intend to create a pull request to fix this issue, which forgoes using preg to match json from log text. It will maintain the ability to parse out multiple contexts.
essell commented
Of course! Thanks for this project.