https://github.com/statikbe/craft-sentry
https://github.com/statikbe/craft-sentry
craftcms
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/statikbe/craft-sentry
- Owner: statikbe
- License: mit
- Created: 2020-09-30T07:47:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-08-05T13:10:42.000Z (11 months ago)
- Last Synced: 2025-09-15T17:18:47.460Z (9 months ago)
- Topics: craftcms
- Language: PHP
- Size: 75.2 KB
- Stars: 2
- Watchers: 9
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Sentry.io for Craft CMS
[Sentry.io](https://sentry.io/) integration for Craft CMS. Inspired by [born05/craft-sentry](https://github.com/born05/craft-sentry), but with our own twist.
## Installation
To install the plugin, follow these instructions in your terminal.
```shell script
cd /path/to/project
composer require statikbe/craft-sentry
./craft plugin/install craft-sentry
```
## Configration
Create a config/craft-sentry.php config file with the following contents:
```php
true,
'anonymous' => true,
'clientDsn' => getenv('SENTRY_DSN') ?: 'https://example@sentry.io/123456789',
'excludedCodes' => ['400', '404', '429'],
'excludedExceptions' => [],
'release' => getenv('SENTRY_RELEASE') ?: null,
];
```
## Usage
To let Sentry log your exception, you don't really need to do anything. Install the plugin and add your DSN and you're set.
When you're writing your own custom code and throwing your own exception, you'll also want to catch those and send them to Sentry. That can be done like this:
```php
[
\craft\errors\ImageTransformException::class,
],
````
---
Brought to you by [Statik.be](https://www.statik.be)