access_log

NGINX SRT 模块的 access_log 指令用于配置 SRT 会话事件和统计的记录。

语法access_log path [format | off];
默认值none
上下文
参数1+

说明

The access_log directive allows users to specify one or more log file paths where SRT session logs will be written. Each specified path can include parameters that dictate the format of the log entries, among other options. This is helpful in tracking the details of SRT communications such as connections established, disconnections, errors, and other relevant statistics. This directive enhances the monitoring capabilities of the SRT server by providing insights into its operation and performance.

在使用 access_log 指令时,用户可以使用预定义格式或自定义格式字符串来指定日志格式。日志格式中常用的字段可能包括远程地址、时间、请求方法和状态码。用户应确保日志文件得到适当轮换或管理,以防止磁盘使用过多。该日志机制遵循 NGINX 的核心日志设计原则,因此在活动会话期间写入日志条目时仍能保持高性能。

配置示例

access_log /var/log/nginx/srt_access.log;

确保日志目录的文件权限正确,以允许 NGINX 进程写入。

日志文件路径必须可被 NGINX 工作进程访问;否则,日志记录将失败。

如果未妥善管理,生成的日志可能会占用大量磁盘空间。

← 返回所有指令