johnbillion / wp-crontrol

Take control of the cron events on your WordPress website
https://wp-crontrol.com
GNU General Public License v2.0
210 stars 36 forks source link

Logging for cron events #19

Open johnbillion opened 6 years ago

johnbillion commented 6 years ago

WP Crontrol should log all cron events for debugging purposes and expose the log somewhere.

This can be achieved by iterating distinct cron hooks in the cron array and adding an action which logs the event. Data to log includes:

Plus:

Stretch Goals:

johnbillion commented 5 years ago

This is in progress in the develop branch. Lots still to do.

Edit: This was pulled out. Needs adding back into the develop branch.

johnbillion commented 4 years ago

This is now available in 2.0.0-beta1. I might push the remaining features to 2.1, we'll see.

danieliser commented 3 years ago

@johnbillion These are listed as built into the 2.0.0-beta, but that got scrubbed to 1.8.0 which has been out for some time. I do not see logging in the current versions. Did this get left out and closed on accident?

johnbillion commented 3 years ago

@danieliser Good point, this got reverted because it needs more work for it to be mature and stable. I didn't want to release a part-baked feature. I'll reopen this issue with more details.

In the meantime you can use the develop branch at this specific commit to get the latest version of the feature before I pulled it out: https://github.com/johnbillion/wp-crontrol/commit/3472d67560caf9bfff4477f0faee12a2a7585e76

Notably, the UX for selecting which hooks are logged needs more work, and there is no mechanism for limiting the number of events that are logged. You'll need to manually clear the logs periodically otherwise your database can balloon.

danieliser commented 3 years ago

Nice, look forward to seeing it finished.

Will say we found 2 plugins that do logging, this one doesn't have a great UI/UX, but seems to function solidly: https://wordpress.org/plugins/cron-logger/

XVII commented 3 years ago

Ooh, would love to see this in Crontrol soon. Was using Cron Logger but it's clunky and not great to use.

Some long running jobs hold up the Cron for longer, so as long as "active" sessions/logs of the Cron remain visible. In Cron Logger they just drop off the page in the history even though it's still running.

martin8032 commented 1 year ago

I would love to see this feature too!

gosixl commented 9 months ago

Me too