-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log cron job results in a table #1
Comments
+1 for this. |
+1 again! |
Another option to avoid the overhead of a table write would be to emit a NOTICE or LOG to the postgresql logs. |
Open to input on this one. Would adding a GUC to enable logging be sufficient or would a table be preferable? I would expect doing a few writes per minute wouldn't be a problem for anyone, though I realise a much desired feature is running jobs every x seconds in which case continuously writing to the results table might not be that great. |
Even just log entries that say that a job was started, when it completed, any errors reported, etc, would be nice. I've got a pg_cron installation that's not showing up in my Postgres logs anywhere, and I have literally no debugging information to track down the problem. |
I've added a success case:
error case:
Will this work? I plan to do a 1.0 release soon and build packages so any feedback is highly appreciated! |
For me that would be a huge help. Not sure about others that +1'd this. :) |
Hello everyone `
` |
Unfortunately, only PostgreSQL 9.5 or higher is supported by pg_cron. I'll clear this up in the README. |
Thank you for your answer. |
If modify source you can build this extension.
But this patch isn't secure. |
This is good - I'd still be interested in the table option though. The log option does make it hard to get at this information for audit as you have to parse all logfiles - not the end of the world but still a pain to assert that it's been run at the correct times. For monitoring you'd have to scrape the log file at each health check, which is really not ideal. |
We just abandoned pg_cron because of the lack of error reporting. Please add decent logging by default. |
Fixed by #111 |
Currently, pg_cron does not give much feedback on the outcome of cron jobs other than what is available from the PostgreSQL log. Add logic to update the cron.result table as tasks progress. Optionally, add a cron job to clean up the table.
The text was updated successfully, but these errors were encountered: