Skip to content

HTTP Access Log in Astra

HTTP Access Logs record every request to Astra’s built-in HTTP server. Use them to track who accesses your streams, diagnose playback issues, or monitor traffic patterns. Access logs are disabled by default.

Enable access logs in SettingsGeneralHTTP Server:

HTTP Access Log: Full path where logs are saved, for example /var/log/astra-access.log

192.168.88.100 - - [11/Aug/2023:07:03:07 +0000] "GET / HTTP/1.1" 200 0
192.168.88.100 - admin [11/Aug/2023:07:03:07 +0000] "POST /control/ HTTP/1.1" 200 0
198.51.100.1 - - [11/Aug/2023:07:03:08 +0000] "GET /play/a0g2/71545838.m3u8 HTTP/1.1" 200 0
198.51.100.1 - - [11/Aug/2023:07:03:08 +0000] "GET /play/a0g2/113900585_92b9.ts HTTP/1.1" 200 0

Each line follows the standard HTTP server format:

remote_addr - remote_user [time] "request" status bytes_sent
  • remote_addr: IP address of the client making the request
  • remote_user: Username if authentication was used, otherwise shown as -
  • time: When the request was received
  • request: HTTP method, requested URL, and protocol version
  • status: HTTP response code (200 for success, 404 for not found, etc.)
  • bytes_sent: Amount of data sent in the response

Access logs grow over time and can fill your disk. Use log rotation to automatically archive old logs and free up space. Linux systems use logrotate to handle this.

Create a configuration file at /etc/logrotate.d/astra-access-log:

/var/log/astra-access.log {
daily
rotate 10
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
systemctl reload astra || true
endscript
}

Configuration options:

  • daily: Rotate logs every day
  • rotate 10: Keep the last 10 archived files
  • missingok: Don’t report errors if the log file doesn’t exist
  • notifempty: Skip rotation if the log file is empty
  • compress: Compress old log files with gzip to save disk space
  • delaycompress: Wait one rotation cycle before compressing to avoid losing recent messages
  • sharedscripts: Run the postrotate script only once, even with multiple log files
  • postrotate: Command that runs after rotation. Reloads Astra so it starts writing to the new log file