Skip to content
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

Add stacktrace to PHP info/warning messages #1448

Open
m-ober opened this issue Apr 7, 2020 · 2 comments
Open

Add stacktrace to PHP info/warning messages #1448

m-ober opened this issue Apr 7, 2020 · 2 comments
Labels
Milestone

Comments

@m-ober
Copy link

m-ober commented Apr 7, 2020

I'm using

$formatter = new LineFormatter();
$formatter->includeStacktraces(true);

For PHP errors (like call to undefined functions) as well as Exceptions, stack traces are now included in the log. But for warnings like

E_WARNING: urlencode() expects parameter 1 to be string, array given

There is no stack trace, which makes it almost impossible to track the problem. Xdebug always shows stack traces, but of course that's only useful when developing.

@m-ober m-ober added the Feature label Apr 7, 2020
@Seldaek
Copy link
Owner

Seldaek commented May 11, 2020

I guess maybe this could be done by passing a new ErrorException into the context data in https://github.com/Seldaek/monolog/blob/master/src/Monolog/ErrorHandler.php and adjusting the stack trace generation to ignore the ErrorHandler frame from the stack trace when it is an ErrorException.

@Seldaek Seldaek added this to the 2.x milestone May 11, 2020
@stefanfisk
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants