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
Log stack traces for PHP warnings etc #14961
Conversation
BTW @katebutler there are some failing tests https://travis-ci.org/matomo-org/matomo/jobs/594801494 and https://travis-ci.org/matomo-org/matomo/jobs/594801495#L818 and as discussed be good to remove the newline. |
@katebutler I'm thinking this failing test might be due to this change? https://travis-ci.org/matomo-org/matomo/jobs/594907204#L817 |
core/ErrorHandler.php
Outdated
@@ -161,8 +161,12 @@ public static function errorHandler($errno, $errstr, $errfile, $errline) | |||
case E_DEPRECATED: | |||
case E_USER_DEPRECATED: | |||
default: | |||
$context = array('trace' => debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katebutler could we add a limit here of say max 15 last traces? There is a second parameter $limit
that can be set.
makes it also easier for users to share the trace since they don't need to remove any paths
Includes the full stack in the log message when writing to file only. The log message for other handlers (web notifications and database) will not be changed.