Skip to content

Audit Logs and Backups

alexisleder edited this page Sep 27, 2026 · 1 revision

Audit Logs and Backups

LederProtections includes audit logs and safe backups to protect server data.


Audit Logs

Audit logs are stored in:

plugins/LederProtections/logs/

They record important operations such as:

  • protection creation
  • protection deletion
  • shop purchases
  • upgrades
  • teleports
  • admin commands
  • member changes
  • co-owner changes
  • blocked player changes
  • repair operations
  • backup restore events

Audit Session Files

LederProtections can create a new audit file on each server start.

Example:

audit-2026-05-29_06-21-02.log

Each session can include:

audit-session-start
audit-session-end

Audit Configuration

audit:
  enabled: true
  console: false
  max-value-length: 160

  file:
    enabled: true
    new-file-each-start: true
    cleanup-old-files: true
    max-files: 30
    shutdown-flush-timeout-ms: 2000
    name: "audit.log"

Log Retention

When enabled, old audit logs are automatically removed.

cleanup-old-files: true
max-files: 30

This prevents the logs folder from growing forever.


Safe Shutdown

On plugin shutdown, LederProtections attempts to flush pending audit log writes.

This helps avoid losing the last log entries during shutdown or restart.


Backups

Protection backups are stored in:

plugins/LederProtections/backups/protections/

Safe Saving

LederProtections uses safe saving for protection data.

It writes to a temporary file first:

protections.yml.tmp

Then validates it before replacing:

protections.yml

Backup Configuration

storage:
  protections:
    safe-save: true
    backups-enabled: true
    max-backups: 10
    restore-latest-backup-on-load-failure: true

Automatic Restore

If protections.yml becomes corrupted, the plugin can attempt to restore the latest valid backup.

This helps protect protection data from crashes or disk write failures.


Recommended Settings

For production servers:

audit:
  enabled: true

storage:
  protections:
    safe-save: true
    backups-enabled: true
    max-backups: 10

Security Note

Audit logs should be considered administrative data.

Do not expose them publicly if they contain player UUIDs, protection IDs, or staff actions.

Clone this wiki locally