VoIP.info Guide

Asterisk AMI LoggerRotate and log-file lifecycle evidence

Use LoggerRotate as one bounded logger action while keeping configuration reload, file reopen, filename strategy, filesystem state, post-rotate work and downstream collection independently verifiable.

Reviewed 2026-10-28Current branch-23-generated and Asterisk 22 LoggerRotate action documentation, AMI framing and authorization guidance, logging commands and configuration, bounded debug collection, ARI logging, current logger source and sample configuration, and source-install logrotate guidance were reviewed October 28, 2026; installed Asterisk and FreePBX versions, downstream patches, logger configuration ownership, runtime channels, file paths, rotation strategy, filesystem permissions and labels, free space, external logrotate or post-rotate commands, syslog, collectors, compression, retention and downstream ingestion remain deployment-specific; no PBX, FreePBX system, logger channel, manager account, credential, command, file, directory, inode, descriptor, filesystem, collector, packet, call or media stream was inspected or testedAdvancedDocumentation based · not lab tested

Freeze the logger owner, node and effective policy

Record the responding node, exact Asterisk branch and maintenance release, process start time, package or build provenance, effective logger.conf owner, log directory, configured file, syslog and console channels, rotatestrategy, external rotation policy, manager identity and permissions, and local and UTC time. Keep a FreePBX-generated file, Asterisk runtime state and an operating-system logrotate rule as separate representations.

LoggerRotate has existed since Asterisk 13, and current branch-23-generated and Asterisk 22 documentation describe the same action. That interface evidence does not establish that one host exposes it, that a desired channel exists, or that its files are writable.

Bound the AMI transaction without extending its claim

Action: LoggerRotate accepts only the optional ActionID. Its documented operation is to reload and rotate the Asterisk logger, analogous to CLI logger rotate; the CLI command is documented to rotate and reopen log files. Retain the raw request, response, matching ActionID, node and timestamps.

A manager success response is action evidence. It is not proof that every expected file was renamed, a new inode was opened, a post-rotate command completed, a collector followed the new file, compression finished, retention ran or disk space was recovered.

Keep reload, rotate and channel-specific APIs distinct

CLI logger reload [<alt-conf>] reloads logger subsystem state and is specifically useful after restarting syslogd; logger rotate rotates and reopens files. Documentation for bounded debug collection also uses module reload logger when applying logger configuration. Treat those names and evidence boundaries separately even where their effects overlap.

ARI can list, add, delete and rotate a named runtime log channel. A per-channel ARI rotation is not the same request contract as the global AMI action, and neither proves the state of queue logs, CDR/CEL backends, syslog or files managed outside the Asterisk logger.

Interpret filenames through the configured rotation strategy

rotatestrategy may be none, sequential, rotate or timestamp. Under none, Asterisk does not internally rotate and an external mechanism must move or rotate files. The other strategies produce different filename histories, so a fixed expected suffix can be wrong even when rotation worked.

exec_after_rotate can invoke a system command, and the documented meaning of ${filename} changes with the strategy. Preserve the exact configured command, substituted name, execution identity and separate exit or artifact evidence; do not infer command success from the AMI response.

Prove the file and downstream custody chain separately

Before and after the action, capture the configured path, directory ownership and mode, applicable security labels, mount and free-space state, inode, file size and modification time, and the Asterisk process file descriptor where authorized. Then generate one bounded non-sensitive event and verify it in the intended newly active destination.

Continue independently through syslog or journal state, shipper cursor or inode tracking, parser, index, compression, retention and archive. An old file growing, a new empty file, a collector reading only the renamed file or delayed ingestion each identifies a different first divergence.

Change narrowly and disclose the untested boundary

Use a dedicated, source-restricted AMI identity with only the required manager class. Preserve pre-action policy and file metadata, run one approved action, record the response, and verify the expected channel and one control channel without deleting active logs or applying broad permission changes. Treat log contents as sensitive and redact credentials, tokens and personal data.

No PBX, FreePBX system, logger channel, manager account, credential, command, file, directory, inode, descriptor, filesystem, collector, packet, call or media stream was inspected or tested. Documentation and source review do not establish deployment availability, compatibility, retention compliance, disk recovery or laboratory validation.

Sources & applicability

Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.

Examples require adaptation to your topology. No live PBX or hardware testing is claimed.