Is there a recommended way to log (failed) cron actions from your plugin? For example, I have a plugin that synchronizes with an external service every hour. I want to log how much was changed, but also when the synchronization failed. What would you recommend here? A new database table? The Log Deprecated Notices plugin does this with a custom post type, but this might be too much overhead? I believe WordPress does not come with a standard logging package?
Finally; you should consider if you want to log the normal case and exceptions, or only exceptions. Jeff Atwood did a good writeup about this. Hope this helps! |
|||||||||
|
|
Use a logging function like this, so that it writes your log out to debug.log by configuring your wp-config.php with the following which I found here:
This should work for debugging/development purposes at least (I'm not sure how great it would be for production logging, but it works for development.) |
|||||
|
|
I agree, putting this data in I'm not afraid of plugins that create tables, but maybe that's because I've seen WordPress databases with 8,000,000
|
|||
|
|