MySQL Enterprise Audit •Log file rotation. This involves rotating the current log file by renaming it, then opening a new current log file using the original name. Rotation can be performed manually, or configured to occur automatically. •Pruning of rotated JSON-format log files, if automatic rotation is enabled. Pruning can be performed based on log file age (as of MySQL 8.0.24), or combined log file size (as of MySQL 8.0.26). To configure audit log file space management, use the following system variables: •If  audit_log_rotate_on_size  is 0 (the default), automatic log file rotation is disabled: •No rotation occurs unless performed manually. •To rotate the current file, manually rename it, then enable  audit_log_flush  to close it and open a new current log file using the original name; see Manual Audit Log File Rotation. •Pruning of rotated JSON-format log files does not occur;  audit_log_max_size  and audit_log_prune_seconds  have no effect. •If  audit_log_rotate_on_size  is greater than 0, automatic audit log file rotation is enabled: •Automatic rotation occurs when a write to the current log file causes its size to exceed the audit_log_rotate_on_size  value, as well as under certain other conditions; see Automatic Audit Log File Rotation. When automatic rotation occurs, the audit log plugin renames the current log file and opens a new current log file using the original name. •Pruning of rotated JSON-format log files occurs if  audit_log_max_size  or audit_log_prune_seconds  has a value greater than 0. • audit_log_flush  has no effect. Note Rotated (renamed) log files are not removed automatically. For example, with size-based log file rotation, renamed log files have unique names and accumulate indefinitely. They do not rotate off the end of the name sequence. To avoid excessive use of space: •As of MySQL 8.0.24 (for JSON-format log files): Enable log file pruning as described in Audit Log File Pruning. •Otherwise (for non-JSON files, or prior to MySQL 8.0.24 for all log formats): Remove old files periodically, backing them up first as necessary. If backed-up log files are encrypted, also back up the corresponding encryption passwords to a safe place, should you need to decrypt the files later. The following sections describe log file rotation and pruning in greater detail. •Automatic Audit Log File Rotation •Manual Audit Log File Rotation •Audit Log File Pruning Manual Audit Log File Rotation If  audit_log_rotate_on_size  is 0 (the default), no log rotation occurs unless performed manually. In this case, the audit log plugin closes and reopens the log file when the  audit_log_flush  value changes 1494