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

Log stack traces for PHP warnings etc #14961

Merged
merged 5 commits into from Oct 9, 2019
Merged

Log stack traces for PHP warnings etc #14961

merged 5 commits into from Oct 9, 2019

Conversation

katebutler
Copy link

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.

@katebutler katebutler added the Needs Review PRs that need a code review label Oct 6, 2019
@katebutler katebutler added this to the 3.13.0 milestone Oct 6, 2019
@katebutler katebutler added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 6, 2019
@tsteur
Copy link
Member

tsteur commented Oct 7, 2019

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.

@tsteur
Copy link
Member

tsteur commented Oct 9, 2019

@katebutler I'm thinking this failing test might be due to this change? https://travis-ci.org/matomo-org/matomo/jobs/594907204#L817

@@ -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));
Copy link
Member

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
@tsteur tsteur merged commit 3cbd95e into 3.x-dev Oct 9, 2019
@tsteur tsteur deleted the logtraces branch October 9, 2019 23:34
@mattab mattab removed the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 25, 2019
@mattab mattab modified the milestones: 3.13.0, 3.12.0 Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants