Copying from Drupal issue queue: https://www.drupal.org/node/2069953
A recent email on the Tripal mailing list.
Hi,
I am working with some Tripal jobs which sometimes fail, e.g. due to bad input files etc. I found myself inserting
debug output via print sometimes. When a job fails I get "Error Message Job has terminated unexpectedly."
in the job details, and running jobs on the console (via tripal_launch_jobs.php) doesn't yield output either. I assume
that the job runs into one or the other 'watchdog()' exceptions, but the output of this doesn't seem to get forwarded.
I think the best solution would be to store the error message and display it via the job interface, because often it might
give valuable hints on how to fix the files. Would that be possible?
Michael
@laceysanderson said:
Quick Update on this:
The newest dev version of Tripal 7.x-2.x logs all tripal_report_error()'s to Apache's Error log.
My current plan for Job logging is:
- Implement basic start/end with job_id logging to /var/log/messages using syslog()
- Create a job_logging API function that each job can implement to give status messages excluding job progress bars. These messages would be both printed to the screen and printed to a file in the /tmp directory where one file would exist per job. These files could then be displayed on the job details page to give people a UI for their jobs output.
- Start implementing this API for the main jobs (ie: bulk loader, OBO, FASTA & GFF3 loaders).
We could also implement a drupal-style progress bar on the job details page using the percent complete but this would be an advanced feature for later I think.
As far as timeline, I'm thinking that 1 & 2 could maybe be implemented for the release candidate but #3 for sure would have to wait and be implemented over time.
After discussion, there are concerns with using /tmp to store job-specific logs. We feel this concern can be alleviated by allowing admin to configure where thse log files end up but defaulting to /tmp.
Additionally, we should take care of log clean-up through Tripal utilizing the Drupal cron.
Stephen also had an interesting suggestion that the Dojo Toolkit (Javascript Library) might provide good support for loading of long log files by allowing files to be loaded in sections as the user scrolls.
Additionally, it has been decided that this functionality will make it into the next release of Tripal and thus is no longer a release blocker.