Download the PHP package justbetter/magento2-sentry without Composer

On this page you can find all versions of the php package justbetter/magento2-sentry. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-sentry

Magento 2 Sentry Logger

Latest Version on Packagist Total Downloads Magento Support PHPStan passing

This Magento 2 module integrates Sentry into magento 2. Depending on the log level configured in the backend of magento 2, notifications and errors can be sent to sentry.

Features

Installation

Configuration

For configuration with Adobe Cloud, check below.

This module uses the Magento Deployment Configuration for most it's configuration. This means that you need to add this array to your app/etc/env.php:

Next to that there are some configuration options under Stores > Configuration > JustBetter > Sentry.

Configuration values

Name Default Description
dsn The DSN you got from Sentry for your project. You can find the DSN in the project settings under "Client Key (DSN)"
environment Specify the environment under which the deployed version is running. Common values: production, staging, development. Helps differentiate errors between environments.
log_level \Monolog\Logger::WARNING Specify from which logging level on Sentry should get the messages.
error_types E_ALL If the Exception is an instance of ErrorException, send the error to Sentry if it matches the error reporting. Uses the same syntax as Error Reporting, e.g., E_ERROR E_WARNING`.
ignore_exceptions [] If the class being thrown matches any in this list, do not send it to Sentry, e.g., [\Magento\Framework\Exception\NoSuchEntityException::class]
clean_stacktrace true Whether unnecessary files (like Interceptor.php, Proxy.php, and Factory.php) should be removed from the stacktrace. (They will not be removed if they threw the error.)
mage_mode_development false If set to true, you will receive issues in Sentry even if Magento is running in develop mode.
js_sdk_version \JustBetter\Sentry\Block\SentryScript::CURRENT_VERSION If set, loads the explicit version of the JavaScript SDK of Sentry.
tracing_enabled false If set to true, tracing is enabled (bundle file is loaded automatically).
traces_sample_rate 0.2 If tracing is enabled, set the sample rate.
performance_tracking_enabled false if performance tracking is enabled, a performance report got generated for the request.
performance_tracking_excluded_areas ['adminhtml', 'crontab'] if performance_tracking_enabled is enabled, we recommend to exclude the adminhtml & crontab area.
profiles_sample_rate 0 (disabled) if this option is larger than 0 (zero), the module will create a profile of the request. Please note that you have to install Excimer on your server to use profiling. Sentry documentation. You have to enable tracing too.
ignore_js_errors [] Array of JavaScript error messages which should not be sent to Sentry. (See also ignoreErrors in Sentry documentation)
disable_default_integrations [] Provide a list of FQCN of default integrations you do not want to use. List of default integrations.
cron_monitoring_enabled false Wether to enable cron check ins
track_crons [] Cron handles of crons to track with cron monitoring, Sentry only supports 6 check-ins per minute Magento does many more.

Configuration for Adobe Cloud

Since Adobe Cloud doesn't allow you to add manually add content to the env.php file, the configuration can be done using the "Variables" in Adobe Commerce using the following variables:

Name Type
CONFIG__SENTRY__ENVIRONMENT__ENABLED boolean
CONFIG__SENTRY__ENVIRONMENT__DSN string
CONFIG__SENTRY__ENVIRONMENT__LOGROCKET_KEY string
CONFIG__SENTRY__ENVIRONMENT__ENVIRONMENT string
CONFIG__SENTRY__ENVIRONMENT__LOG_LEVEL integer
CONFIG__SENTRY__ENVIRONMENT__ERROR_TYPES integer
CONFIG__SENTRY__ENVIRONMENT__IGNORE_EXCEPTIONS JSON array of classes
CONFIG__SENTRY__ENVIRONMENT__CLEAN_STACKTRACE boolean
CONFIG__SENTRY__ENVIRONMENT__MAGE_MODE_DEVELOPMENT string
CONFIG__SENTRY__ENVIRONMENT__JS_SDK_VERSION string
CONFIG__SENTRY__ENVIRONMENT__TRACING_ENABLED boolean
CONFIG__SENTRY__ENVIRONMENT__TRACING_SAMPLE_RATE float
CONFIG__SENTRY__ENVIRONMENT__TRACING_PERFORMANCE_TRACKING_ENABLED boolean
CONFIG__SENTRY__ENVIRONMENT__TRACING_PERFORMANCE_TRACKING_EXCLUDED_AREAS boolean
CONFIG__SENTRY__ENVIRONMENT__IGNORE_JS_ERRORS JSON array of error messages

The following configuration settings can be overridden in the Magento admin. This is limited to ensure that changes to particular config settings can only be done on server level and can't be broken by changes in the admin.

Please note, that it is not possible to use profiling within the Adobe Cloud.

Optional error page configuration

Sending additional data to Sentry when logging errors

Change / Filter events

This module has an event called sentry_before_send that is dispatched before setting the config before_send. This provides the means to edit / filter events. You could for example add extra criteria to determine if the exception should be captured to Sentry. To prevent the Exception from being captured you can set the event to null or unset it completly.

Example: https://github.com/justbetter/magento2-sentry-filter-events

This same thing is the case for
sentry_before_send https://docs.sentry.io/platforms/php/configuration/options/#before_send
sentry_before_send_transaction https://docs.sentry.io/platforms/php/configuration/options/#before_send_transaction
sentry_before_send_check_in https://docs.sentry.io/platforms/php/configuration/options/#before_send_check_in
sentry_before_breadcrumb https://docs.sentry.io/platforms/php/configuration/options/#before_breadcrumb

Compatibility

The module is tested on Magento version 2.4.x with sentry sdk version 3.x. feel free to fork this project or make a pull request.

Ideas, bugs or suggestions?

Please create a issue or a pull request.

Contributing

Contributing? Awesome! Thank you for your help improving the module!

Please see CONTRIBUTING for details.

Most importantly:

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

The MIT License (MIT). Please see License File for more information.


All versions of magento2-sentry with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
sentry/sentry Version ^4.4
monolog/monolog Version >=2.7.0|^3.0
magento/framework Version >=103.0.7
magento/module-csp Version *
nyholm/psr7 Version ^1.2
magento/module-config Version >=101.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package justbetter/magento2-sentry contains the following files

Loading the files please wait ....