问题描述
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $http_grpc_status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
但不起作用,Nginx将仅记录http状态代码,而不记录grpc_status
解决方法
*是什么意思? GRPCS状态?
您已经尝试过了
-
制作文件日志:
- nano / var / log / nginx / [filelog] .log
-
[关闭并保存]
-
在.conf
中尝试
out服务器指令
log_format prog3'$ remote_addr-$ remote_user [$ time_local]“ $ request”'
'$ status $ body_bytes_sent“ $ http_referer”'
'“ $ http_user_agent” $ server_port $ scheme';
在服务器指令中
服务器{
....
access_log /var/log/nginx/[filelog].log prog3;
- 然后在模式调试中执行nginx
- 停止nginx
- /etc/init.d/nginx停止
- 运行nginx-debug
- /etc/init.d/nginx-debug start