Best practice for logging errors in a plugin?
-
I inherited a custom plugin that has some try-catch statements. I suspect one of them is failing occasionally. I would like to always log the error message in the catch clause. However, the articles I’ve found so far via google (here and here) all recommend wrapping logging in a WP_DEBUG check.
Is there a way for me to log to WordPress’ standard debug/error log from a plugin regardless of WP_DEBUG being enabled, or is it working that way by design? I haven’t been able to reproduce the error, so I would prefer to not leave debugging active on my production site for any period of time in the hopes of catching this error in the wild.
Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Best practice for logging errors in a plugin?’ is closed to new replies.