自定义nginx日志记录格式
时间:2016-12-27 14:36 来源:linux.it.net.cn 作者:IT
今天在一份nginx配置文件中见到一个日志配置指令:
access_log /data1/logs/interface-access-log bilog
前面那部分很容易懂,就是把访问日志记录到/data1/logs/interface-access-log这个文件里,但是后面那个bilog是什么东西呢?
后来查了一下,发现原来这个bilog是用户自己定义的一种日志格式,在配置文件中搜索bilog就可以发现一段这样的配置:
log_format bilog '$remote_addr\t$remote_user\t[$time_local]\t$request'
'\t$status\t$body_bytes_sent\t$http_referer'
'\t$http_user_agent\t$http_x_forwarded_for'
'\t$host\t$request_time\t$upstream_addr';
完) (责任编辑:IT)
今天在一份nginx配置文件中见到一个日志配置指令: access_log /data1/logs/interface-access-log bilog 前面那部分很容易懂,就是把访问日志记录到/data1/logs/interface-access-log这个文件里,但是后面那个bilog是什么东西呢? 后来查了一下,发现原来这个bilog是用户自己定义的一种日志格式,在配置文件中搜索bilog就可以发现一段这样的配置: log_format bilog '$remote_addr\t$remote_user\t[$time_local]\t$request' '\t$status\t$body_bytes_sent\t$http_referer' '\t$http_user_agent\t$http_x_forwarded_for' '\t$host\t$request_time\t$upstream_addr'; 完) (责任编辑:IT) |