{"id":1412,"date":"2008-10-01T22:58:47","date_gmt":"2008-10-01T22:58:47","guid":{"rendered":"http:\/\/www.icocean.com\/blog\/?p=1412"},"modified":"2008-10-01T22:59:07","modified_gmt":"2008-10-01T22:59:07","slug":"apacheresinlog%E8%BE%93%E5%87%BA%E6%A0%BC%E5%BC%8F","status":"publish","type":"post","link":"https:\/\/www.icocean.com\/blog\/?p=1412","title":{"rendered":"Apache\/resin log\u8f93\u51fa\u683c\u5f0f"},"content":{"rendered":"<p>Apache \u4e00\u822c\u6709\u4e24\u79cd\u65e5\u5fd7\u683c\u5f0f\uff1a<br \/>\u901a\u7528\u65e5\u5fd7\u683c\u5f0f(Common Log Format) \u548c \u7ec4\u5408\u65e5\u5fd7\u683c\u5f0f(Combined Log Format)<\/p>\n<p>http.conf\u4e2d\u9ed8\u8ba4\u683c\u5f0f\u5982\u4e0b\uff1a<br \/>LogFormat \u201c%h %l %u %t &#92;\u201d%r&#92;\u201d %>s %b\u201d common<br \/>LogFormat \u201c%h %l %u %t &#92;\u201d%r&#92;\u201d %>s %b &#92;\u201d%{Referer}i&#92;\u201d &#92;\u201d%{User-agent}i&#92;\u201d&#8221; combined<\/p>\n<p>\u4e5f\u53ef\u4ee5\u4f7f\u7528\u81ea\u5b9a\u4e49\uff0c\u8fd9\u91cc\u4f7f\u7528`\u5206\u9694 \u65e5\u5fd7\u53c2\u6570<\/p>\n<p>%h`%l`%u`%{%Y-%m-%d %H:%M:%S}t`%r`%s`%b`%{Referer}i`%{User-Agent}i`%{X-Up-Calling-Line-ID}i<\/p>\n<p>\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b\uff1a<br \/>127.0.0.1 &#8211; frank [10\/Oct\/2000:13:55:36 -0700] \u201cGET \/apache_pb.gif HTTP\/1.0\u2033 200 2326<br \/>127.0.0.1 &#8211; frank [10\/Oct\/2000:13:55:36 -0700] \u201cGET \/apache_pb.gif HTTP\/1.0\u2033 200 2326 \u201chttp:\/\/www.example.com\/start.html\u201d \u201cMozilla\/4.08 [en] (Win98; I ;Nav)\u201d<br \/>172.16.0.115`-`-`2008-03-13 11:00:03`GET \/logo.gif HTTP\/1.1`200`2893`http:\/\/172.16.0.252\/index.jsp `Opera\/9.26 (Windows NT 5.1; U; zh-cn)`-<!--more--><\/p>\n<p>%h&nbsp;&nbsp;\u8fd9\u662f\u53d1\u9001\u8bf7\u6c42\u5230\u670d\u52a1\u5668\u7684\u5ba2\u6237\u7684IP\u5730\u5740,\u5982\u679c\u5ba2\u6237\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u5b58\u5728\u4ee3\u7406\uff0c\u90a3\u4e48\u8bb0\u5f55\u4e2d\u7684\u8fd9\u4e2aIP\u5730\u5740\u5c31\u662f\u90a3\u4e2a\u4ee3\u7406\u7684IP\u5730\u5740\uff0c\u800c\u4e0d\u662f\u5ba2\u6237\u673a\u7684\u771f\u5b9eIP\u5730\u5740\u3002<br \/>%l \u8fd9\u662f\u7531\u5ba2\u6237\u7aefidentd\u8fdb\u7a0b\u5224\u65ad\u7684RFC1413\u8eab\u4efd(identity)\uff0c\u8f93\u51fa\u4e2d\u7684\u7b26\u53f7\u201d-\u201d\u8868\u793a\u6b64\u5904\u7684\u4fe1\u606f\u65e0\u6548\u3002\u9664\u975e\u5728\u4e25\u683c\u63a7\u5236\u7684\u5185\u90e8\u7f51\u7edc\u4e2d\uff0c\u6b64\u4fe1\u606f\u901a\u5e38\u5f88\u4e0d\u53ef\u9760\uff0c\u4e0d\u5e94\u8be5\u88ab\u4f7f\u7528\u3002\u53ea\u6709\u5728\u5c06IdentityCheck\u6307\u4ee4\u8bbe\u4e3a On \u65f6\uff0cApache\u624d\u4f1a\u8bd5\u56fe\u5f97\u5230\u8fd9\u9879\u4fe1\u606f\u3002<br \/>%u \u8fd9\u662fHTTP\u8ba4\u8bc1\u7cfb\u7edf\u5f97\u5230\u7684\u8bbf\u95ee\u8be5\u7f51\u9875\u7684\u5ba2\u6237\u6807\u8bc6(userid)\uff0c\u73af\u5883\u53d8\u91cfREMOTE_USER\u4f1a\u88ab\u8bbe\u4e3a\u8be5\u503c\u5e76\u63d0\u4f9b\u7ed9CGI\u811a\u672c\u3002\u5982\u679c\u72b6\u6001\u7801\u662f401\uff0c\u8868\u793a\u5ba2\u6237\u672a\u901a\u8fc7\u8ba4\u8bc1\uff0c\u5219\u6b64\u503c\u6ca1\u6709\u610f\u4e49\u3002\u5982\u679c\u7f51\u9875\u6ca1\u6709\u8bbe\u7f6e\u5bc6\u7801\u4fdd\u62a4\uff0c\u5219\u6b64\u9879\u5c06\u662f\u201d-\u201d\u3002<\/p>\n<p>%{%Y-%m-%d %H:%M:%S}t<br \/>\u8fd9\u662f\u670d\u52a1\u5668\u5b8c\u6210\u8bf7\u6c42\u5904\u7406\u65f6\u7684\u65f6\u95f4\u3002<br \/>\u5176\u683c\u5f0f\u662f\uff1a<br \/>[\u65e5\/\u6708\/\u5e74:\u65f6:\u5206:\u79d2 \u65f6\u533a]<br \/>\u65e5 = 2\u6570\u5b57<br \/>\u6708 = 3\u5b57\u6bcd<br \/>\u5e74 = 4\u6570\u5b57<br \/>\u65f6 = 2\u6570\u5b57<br \/>\u5206 = 2\u6570\u5b57<br \/>\u79d2 = 2\u6570\u5b57<br \/>\u65f6\u533a = (+&#124;-)4\u6570\u5b57<br \/>\u53ef\u4ee5\u5728\u683c\u5f0f\u5b57\u7b26\u4e32\u4e2d\u4f7f\u7528 %{format}t \u6765\u6539\u53d8\u65f6\u95f4\u7684\u8f93\u51fa\u5f62\u5f0f\uff0c\u5176\u4e2d\u7684format\u4e0eC\u6807\u51c6\u5e93\u4e2d\u7684strftime()\u7528\u6cd5\u76f8\u540c\u3002<br \/>\u5982\uff1a%Y-%m-%d %H:%M:%S \u2014 2008-03-13 11:00:03<\/p>\n<p>%r \u5f15\u53f7\u4e2d\u662f\u5ba2\u6237\u7aef\u53d1\u51fa\u7684\u5305\u542b\u8bb8\u591a\u6709\u7528\u4fe1\u606f\u7684\u8bf7\u6c42\u884c\u3002\u53ef\u4ee5\u770b\u51fa\uff0c\u8be5\u5ba2\u6237\u7684\u52a8\u4f5c\u662fGET \uff0c\u8bf7\u6c42\u7684\u8d44\u6e90\u662f\/logo.gif \uff0c\u4f7f\u7528\u7684\u534f\u8bae\u662fHTTP\/1.1 \u3002\u53e6\u5916\uff0c\u8fd8\u53ef\u4ee5\u8bb0\u5f55\u5176\u4ed6\u4fe1\u606f\uff0c\u5982\uff1a\u683c\u5f0f\u5b57\u7b26\u4e32\u201d%m %U%q %H\u201d\u4f1a\u8bb0\u5f55\u52a8\u4f5c\u3001\u8def\u5f84\u3001\u67e5\u8be2\u5b57\u7b26\u4e32\u3001\u534f\u8bae\uff0c\u5176\u8f93\u51fa\u548c\u201d%r\u201d\u4e00\u6837\u3002<\/p>\n<p>%s \u8fd9\u662f\u670d\u52a1\u5668\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u7684\u72b6\u6001\u7801\u3002\u8fd9\u4e2a\u4fe1\u606f\u975e\u5e38\u6709\u4ef7\u503c\uff0c\u56e0\u4e3a\u5b83\u6307\u793a\u4e86\u8bf7\u6c42\u7684\u7ed3\u679c\uff0c\u6216\u8005\u662f\u88ab\u6210\u529f\u54cd\u5e94\u4e86(\u4ee52\u5f00\u5934)\uff0c\u6216\u8005\u88ab\u91cd\u5b9a\u5411\u4e86(\u4ee53\u5f00\u5934)\uff0c\u6216\u8005\u51fa\u9519\u4e86(\u4ee54\u5f00\u5934)\uff0c\u6216\u8005\u4ea7\u751f\u4e86\u670d\u52a1\u5668\u7aef\u9519\u8bef(\u4ee55\u5f00\u5934)\u3002<br \/>\u670d\u52a1\u5668\u54cd\u5e94\u5417\u5217\u8868 \uff1a<br \/>&nbsp;&nbsp;Successful 2xx<br \/>200 OK \u2026..<br \/>201 Created<br \/>202 Accepted<br \/>203 Non-Auth<br \/>204 No Conte<br \/>205 Reset Co<br \/>206 Partial<br \/>Redirection 3xx<br \/>300 Multiple<br \/>301 Moved Pe<br \/>302 Found ..<br \/>303 See Othe<br \/>304 Not Modi<br \/>305 Use Prox<br \/>306 (Unused)<br \/>307 Temporar<br \/>&nbsp;&nbsp;Client Error 4x<br \/>400 Bad Req<br \/>401 Unautho<br \/>402 Payment<br \/>403 Forbidd<br \/>404 Not Fou<br \/>405 Method<br \/>406 Not Acc<br \/>407 Proxy A<br \/>408 Request<br \/>409 Conflic<br \/>410 Gone ..<br \/>411 Length<br \/>412 Precond<br \/>413 Request<br \/>414 Request<br \/>415 Unsuppo<br \/>416 Request<br \/>417 Expecta<br \/>&nbsp;&nbsp;Server Error 5x<br \/>500 Internal<br \/>501 Not Impl<br \/>502 Bad Gate<br \/>503 Service<br \/>504 Gateway<br \/>505 HTTP Ver<\/p>\n<p>%b \u6700\u540e\u8fd9\u9879\u662f\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u7684\u4e0d\u5305\u62ec\u54cd\u5e94\u5934\u7684\u5b57\u8282\u6570\u3002\u5982\u679c\u6ca1\u6709\u4fe1\u606f\u8fd4\u56de\uff0c\u5219\u6b64\u9879\u5e94\u8be5\u662f\u201d-\u201d\uff0c\u5982\u679c\u5e0c\u671b\u8bb0\u5f55\u4e3a\u201d0\u2033\u7684\u5f62\u5f0f\uff0c\u5c31\u5e94\u8be5\u7528%B \u3002<br \/>%{Referer}i<br \/>\u201cReferer\u201d\u8bf7\u6c42\u5934\u3002\u6b64\u9879\u6307\u660e\u4e86\u8be5\u8bf7\u6c42\u662f\u88ab\u4ece\u54ea\u4e2a\u7f51\u9875\u63d0\u4ea4\u8fc7\u6765\u7684\uff0chttp:\/\/172.16.0.252\/index.jsp \u8fd9\u4e2a\u7f51\u9875\u5e94\u8be5\u5305\u542b\u6709\/logo.gif \u6216\u8005\u5176\u8fde\u63a5\u3002<\/p>\n<p>%{User-Agent}i<br \/>\u201cUser-Agent\u201d\u8bf7\u6c42\u5934\u3002\u6b64\u9879\u662f\u5ba2\u6237\u7aef\u63d0\u4f9b\u7684\u6d4f\u89c8\u5668\u8bc6\u522b\u4fe1\u606f\u3002\u5982\uff1a\uff08Opera\/9.26 (Windows NT 5.1; U; zh-cn)&nbsp;&nbsp; Mozilla\/4.08 [en] (Win98; I ;Nav \uff09<br \/>%{X-Up-Calling-Line-ID}i<br \/>\u5982\u679c\u4f7f\u7528\u624b\u673a\u8bbf\u95ee\uff0c\u5e76\u4e14\u79fb\u52a8\uff08\u8054\u901a\uff09\u7f51\u5173\u53ef\u4ee5\u8fd4\u56de\u8bbf\u95ee\u8005\u7684\u624b\u673a\u53f7\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache \u4e00\u822c\u6709\u4e24\u79cd\u65e5\u5fd7\u683c\u5f0f\uff1a\u901a\u7528\u65e5\u5fd7\u683c\u5f0f(Common Log Format) \u548c \u7ec4\u5408\u65e5\u5fd7\u683c\u5f0f(Com <a href='https:\/\/www.icocean.com\/blog\/?p=1412' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[638,1883,1885],"class_list":["post-1412","post","type-post","status-publish","format-standard","hentry","category-lamp","tag-apache","tag-log","tag-1885","category-24-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1412"}],"version-history":[{"count":0,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1412\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}