Skip to main content

Job Execution Logs

Overview

Every scheduled job on the platform is instrumented to record its execution in JobExecutionLogEntity. Admins can view the full history, filter by job name and status, and investigate failures. Logs older than 30 days are automatically purged.


Scheduled Jobs Reference

Job NameSchedulePurpose
member-auto-reinstateDaily 01:00 UTCAuto-reinstate expired suspensions
poll-auto-closeDaily 00:30 UTCClose expired polls
peer-badge-awardHourlyAward peer badges (≥3 nominations)
rank-recalculationDaily 02:00 UTCRecalculate member ranks
season-resetJan 1 00:05 UTCArchive RP + reset seasonal scores
season-reset-reminderDec 25 12:00 UTCNotify members of upcoming season end
job-execution-cleanupDaily 03:00 UTCDelete logs older than 30 days
gdpr-purgeDaily 04:00 UTCDelete PII for soft-deleted users

Workflow


Step-by-Step: View Job Execution History

  1. Navigate to Admin → Job Logs (/admin/jobs).
  2. The paginated list shows all job executions, newest first.
  3. Use the filter to narrow by:
    • Job Name (e.g., rank-recalculation)
    • Status (RUNNING / SUCCESS / FAILURE)
  4. Each row shows: job name, status, start time, duration, rows affected.
  5. Click a row to see the full log entry including error message and trace ID.

Step-by-Step: Investigate a Failure

  1. Filter by Status: FAILURE.
  2. Click the failed job entry.
  3. Read the error message and stack trace.
  4. Note the traceId — use it to search application logs (Grafana Loki) for the correlated log lines.

Application Properties

SchedulerScheduleLockDescription
JobExecutionLogCleanupSchedulerDaily 03:00 UTCjob-execution-cleanupDeletes logs older than 30 days

Security Notes

  • ADMIN only for all job log endpoints.
  • Logs are append-only — cannot be modified or deleted via API (only by the cleanup scheduler).
  • traceId in each log entry links to distributed traces in Jaeger / Grafana Tempo for full context.

QA Checklist

  • Trigger a scheduled job manually (or wait for schedule) → new entry created with RUNNING status
  • Job completes successfully → status updates to SUCCESS with duration + rowsAffected
  • Job fails → status FAILURE with error message
  • Filter by job name → only matching entries shown
  • Filter by FAILURE → only failed jobs shown
  • traceId in log → can be used to search Loki logs
  • Access as non-admin → 403 Forbidden