admin管理员组

文章数量:1387396

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://[email protected]/123456789' ]);

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

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://[email protected]/123456789' ]);

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

Share Improve this question asked Apr 29, 2020 at 9:21 wharfdalewharfdale 3484 silver badges17 bronze badges 1
  • 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 Commented Apr 29, 2020 at 10:10
Add a comment  | 

1 Answer 1

Reset to default 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.

本文标签: debugBest location for a debugging script