CUPS 2.x supports automatic debug logging for failed print jobs. PAPPL should offer the same functionality.