nginx - log format

                 

nginx - log_format

log_format

 

syntax: log_format name format [format ...]

default: log_format combined "..."

context: http server

Directivelog_format describes the format of a log entry. Besides generalvariables in the format it is possible to use variables which existonly at the moment of record into the log:

  • $body_bytes_sent,the number of bytes, transmitted to client minus the response headers,variable is compatible with parameter %B of module Apache'smod_log_config (this was called $apache_bytes_sent, before version0.3.10)
  • $bytes_sent, the number of bytes, transmitted to client
  • $connection, the number of connection
  • $msec, the time with an accuracy to microseconds at the moment of the log entry
  • $pipe, "p" if request was pipelining

  • $request_length, the length of the body of the request
  • $request_time, the time of working on request in seconds, since 0.5.19 in millisecond precision
  • $status, status of answer
  • $time_local, local time into common log format.
  • $http_x_forwarded_for, X-Forward infomation

The headers, transmitted to client, begin from the prefix "sent_http_", for example, $sent_http_content_range.

Notethat variables produced by other modules can also be logged. Forexample you can log upstream response headers with the prefix"upstream_http_", see upstream.

In the configuration there is always a predetermined format "combined":

 

log_format  combined  '$remote_addr - $remote_user [$time_local] '
                      '"$request" $status $body_bytes_sent '
                      '"$http_referer" "$http_user_agent"';

[log_format文档]

http://wiki.codemongers.com/NginxHttpLogModule#log_format

[相关问题]

log_format

           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值