课程评价 (0)

请对课程作出评价:
0/300

学员评价

暂无精选评价
2分钟

日志相关设置

ngx_http_log_module**模块**

指定日志格式记录请求

1、log_format name string …;

string可以使用nginx核心模块及其它模块内嵌的变量

2、access_log path [format buffer=sizegzip=level] flush=time

if=condition];

access_log off;

访问日志文件路径,格式及相关的缓冲的配置

buffer=size

flush=time

3、open_log_file_cache max=N inactive=time valid=time;

open_log_file_cache off;

缓存各日志文件相关的元数据信息

max:缓存的最大文件描述符数量

min_uses:在inactive指定的时长内访问大于等于此值方可被当作活动项

inactive:非活动时长

valid:验证缓存中各缓存项是否为活动项的时间间隔

示例:自定义日志

系统默认:

自定义一个日志:

添加到access_log(可添加到任何语句块中)

测试日志