{% extends "base.html" %} {% block title %}Activity Logs{% endblock %} {% block page_title %}Activity Logs{% endblock %} {% block content %}
Log Summary
{{ '{:,}'.format(total) }}
total log entries
{% if oldest %}
Oldest entry: {{ oldest.strftime('%b %d, %Y') }}
{% endif %}
Entries eligible for cleanup:
{% for days, count in counts_by_retention.items() %}
Older than {{ days }} days {{ '{:,}'.format(count) }}
{% endfor %}
Clean Up Old Logs — permanently deletes entries older than the selected threshold

Select a retention period. All activity log entries older than that threshold will be permanently deleted and cannot be recovered. This action is itself logged before the deletion runs.

{% set options = [ (7, 'danger', 'bi-lightning-charge', 'Last 7 days', 'Aggressive — keeps only the past week'), (30, 'warning', 'bi-calendar-week', 'Last 30 days', 'Recommended for busy systems'), (60, 'info', 'bi-calendar-month', 'Last 60 days', 'Balanced retention'), (90, 'success', 'bi-calendar3', 'Last 90 days', 'Conservative — keeps 3 months'), ] %} {% for days, colour, icon, label, hint in options %}
{% endfor %}
System Activity Log — page {{ logs.page }} of {{ logs.pages }} ({{ '{:,}'.format(logs.total) }} entries)
{% for log in logs.items %} {% endfor %}
Timestamp Action User Entity Details IP Address
{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') }} {{ log.action }} {% if log.user %} {{ log.user.full_name }}
{{ log.user.email }} {% else %} System {% endif %}
{{ log.entity_type or '—' }}{% if log.entity_id %} #{{ log.entity_id }}{% endif %} {{ log.details or '—' }} {{ log.ip_address or '—' }}
{% if logs.pages > 1 %}
{% endif %}
{% endblock %}