Comments (8)
@martinhellwagner currently (2.0.1) the plugin uses App::env
, which should automatically solve this.
see: https://github.com/craftcms/cms/blob/main/src/helpers/App.php#L91
Additionally: Craft 4 has deprecated the ENVIRONMENT
env in favor of CRAFT_ENVIRONMENT
.
from craft-sentry.
Thanks for the clarification! Is it possible to use version 2.x
of the plugin with Craft 3 as well? We haven't yet upgraded the project to Craft 4.
from craft-sentry.
@martinhellwagner not sure, but i think not. The upside is that the craft 3 version of the plugin does lean on the ‘CRAFT_ENVIRONMENT’ variable.
from craft-sentry.
Is there any way to make the 1.x
version of the plugin work when the CRAFT_ENVIRONMENT
variable is not correctly consumed?
from craft-sentry.
@martinhellwagner not sure what you mean, isn’t this working? It should be just using the var as usual in craft 3.
https://github.com/born05/craft-sentry/blob/master/src/Plugin.php#L64
from craft-sentry.
We're setting the variable like this in our web/index.php
file:
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');
But in line 64 of the Plugin.php
file, this variable isn't available and can't be consumed, resulting in a failure of our pipeline (or every time a Sentry error should be reported).
from craft-sentry.
Just to be sure, is the variable set before bootstrapping craft? And is it also set in the ‘craft’ file? Later versions of craft 3 suggest using a bootstrap.php, to make sure they are the same in both files.
from craft-sentry.
Acutally, it was not set in the craft
file. That seems to have been the issue. Thanks a lot for pointing that out! 👍🏼
from craft-sentry.
Related Issues (20)
- Question: Usage inside another plugin HOT 3
- excludedCodes is not used anymore HOT 4
- Logging console exceptions HOT 1
- Not logging in devMode HOT 1
- sentry-sdk.php config is ignored in latest version(s)? HOT 8
- Error when used in conjunction with Link field plugin HOT 6
- Access getLastEventID method HOT 5
- Load Sentry JS SDK on front end requests. HOT 2
- Enabling JS errors interferes with frontend JS HOT 2
- Craft SystemReport shows OutOfBoundsException error when craft-sentry is enabled HOT 3
- Include autoSessionTracking setting in JS integration HOT 4
- "Element query executed before Craft is fully initialized" warning when using craft-sentry HOT 2
- Add IP address to user data if anonymous mode is not enabled
- Remove 400/429 error codes being hidden by default HOT 1
- NotFoundHttpException from templates HOT 2
- Sentry URL tag values are invalid URLs HOT 1
- User data in request body HOT 6
- Add the ability to supress specific exceptions HOT 1
- Updating from 2.0.1 to 3.0.0 leads to "missing clientKey" error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-sentry.