Skip to main content

AFS_AETHER_LOG_ROTATION_MAX_FILES

Deep-dive reference for:

  • AFS_AETHER_LOG_ROTATION_MAX_FILES

Status

  • active

Audience

  • production/user

Type and Default

  • Type: unsigned integer count (usize), must be > 0.
  • Default behavior:
    • If size rotation is active and no explicit value is set: 5.
    • If rotation mode is not size and this var is unset: no effect.

What It Does

Sets how many rotated archive files are retained in size-based log rotation.

Archives are managed with numbered suffixes (.1, .2, ...), with .1 being the most recent rolled file.

Input Surface

  • Env: AFS_AETHER_LOG_ROTATION_MAX_FILES=<count>

There is currently no dedicated CLI flag for this setting.

Interaction With Rotation Mode

  • If current rotation mode is already size, this updates only max_files.
  • If current rotation mode is not size, setting this variable switches effective mode to size and keeps max_bytes at the default (50 * 1024 * 1024) unless separately overridden.

Interaction With Destination

This limit is only used when:

  • AFS_AETHER_LOG_DESTINATION=file
  • effective rotation mode is size

If destination is stdout/stderr, the value is loaded but not used by the active writer.

Validation

  • Parse errors fail config load.
  • 0 is rejected with:
    • value must be greater than zero

Reload Behavior (SIGHUP)

Because this value is part of log_rotation, changes are detected but not hot-applied. Restart is required for new limits to take effect.

Examples

  • Keep 3 rotated files:
    • AFS_AETHER_LOG_DESTINATION=file AFS_AETHER_LOG_ROTATION_MAX_FILES=3 aether mount --session-id s1 --mount-dir /mnt/aether
  • Set both size threshold and retention count:
    • AFS_AETHER_LOG_DESTINATION=file AFS_AETHER_LOG_ROTATION_MAX_BYTES=10485760 AFS_AETHER_LOG_ROTATION_MAX_FILES=7 aether mount --session-id s1 --mount-dir /mnt/aether
  • AFS_AETHER_LOG_ROTATION
  • AFS_AETHER_LOG_ROTATION_MAX_BYTES
  • AFS_AETHER_LOG_DESTINATION
  • AFS_AETHER_LOG_PATH

Primary Implementation Sources

  • packages/aether/src/config/types/apply_env.rs
  • packages/aether/src/config/types/model_defaults.rs
  • packages/aether/src/observability/logging.rs
  • packages/aether/src/config/reload.rs