0

I am integrating Sentry.io into my multisite setup. I have 5 themes and a number of plugins across the network too.

Sentry needs to be initialised as early as possible, I want it to be loaded before the plugins so it can track issues with the plugins too. Where is the best place to insert the following:

To capture all errors, even the one during the startup of your application, you should initialize the Sentry PHP SDK as soon as possible.

Sentry\init(['dsn' => 'https://123456789@sentry.io/123456789' ]);

As mentioned, I have multiple themes, so I don't suspect putting this line in each theme is correct.

  • Could you include it into wp-config.php? Earliest way to load it in a file that won’t be affected by updates. – Jacob Peattie Apr 29 at 10:10
1

Maybe as a must-use plugin?

From docs,

  • Always-on, no need to enable via admin and users cannot disable by accident.
  • Can be enabled simply by uploading file to the mu-plugins directory, without having to log-in.
  • Loaded by PHP, in alphabetical order, before normal plugins, meaning API hooks added in an mu-plugin apply to all other plugins even if they run hooked-functions in the global namespace.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.