Sentry Plugin

I work at a small software company and part of our portfolio of services is DokuWiki support and development. Part of that is creating and testing completely new features (usually in plugin form) and sometimes my colleagues will be the guinea pigs to test that new code.

When my colleague Michael asked me about how to best test and get feedback on a particular complex piece of code, my immediate thought was "Sentry".

Sentry is an Open Source error tracking tool (they also offer a hosted solution). We use it extensively in larger customer projects. Once integrated, it will automatically catch all the errors that your code for some reason did not handle. The error is then automatically logged to the central Sentry service and the developers are informed about the new problem.

This makes it easy to find errors that you simply didn't anticipate and that only happen in a live environment. The cool thing about Sentry is that it not only logs the error in question but also stores all kinds of additional info. That includes things like the used browser, the current request or a stack trace. This makes it much easier to debug or reproduce errors.

So Michael and I set down to write a Sentry plugin for DokuWiki. The goal was to make the integration as simple as possible. All you have to do is install the plugin, configure your Sentry DSN and it works automatically for the backend and the frontend.

Of course the plugin also provides some methods to log additional errors to Sentry programmatically. Useful for where you catch errors but think they usually shouldn't happen. Sentry will help you to figure out why they happen anyway. Even when Sentry can't be reached (for example because your laptop is offline) errors are saved locally and sending is retried later.

The plugin also offers the silent logging of problems that are usually suppressed to be shown to end users, like PHP notices or deprecation warnings. This way developers can notice possible problems in their code without interrupting their users.

The plugin is now available on Github.

Andreas Gohr

creating DokuWiki

Andreas Gohr

creating DokuWiki