Skip to content

Add the ability to set a project root - #15

Open
Stoux wants to merge 2 commits into
interjar:masterfrom
Stoux:improvement/project-root
Open

Add the ability to set a project root#15
Stoux wants to merge 2 commits into
interjar:masterfrom
Stoux:improvement/project-root

Conversation

@Stoux

@Stoux Stoux commented Sep 30, 2019

Copy link
Copy Markdown

This adds the ability to set a project root, bugsnag docs: https://docs.bugsnag.com/platforms/php/other/configuration-options/#project-root.

By either setting the absolute path or the value true in the env.php file you can set the project root in Bugsnag. Bugsnag will strip the paths from errors & exceptions, normalising the paths across all deployments.

When the value true is entered, it will resolve the path using Magento's DirectoryList.

This allows you to strip the deployment path from Bugsnag errors, normalising all paths across multiple deployments.
See: https://docs.bugsnag.com/platforms/php/other/configuration-options/#project-root
Comment thread Helper/Config.php
if ($projectRoot === true) {
// The root should be resolved by Magento
return $this->directoryList->getRoot();
} else {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about adding a } if else (is_dir($projectroot)) { check here, but figured this allows more flexibility? Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant