{"id":570,"date":"2010-12-11T15:15:07","date_gmt":"2010-12-11T15:15:07","guid":{"rendered":""},"modified":"2010-12-11T15:15:07","modified_gmt":"2010-12-11T15:15:07","slug":"570","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=570","title":{"rendered":"\u8bbe\u7f6eapache\u65e5\u5fd7\u6587\u4ef6\u6bcf\u5929\u8bb0\u5f55\u4e3a\u4e00\u4e2a\u6587\u4ef6"},"content":{"rendered":"<p>apahce\u65e5\u5fd7\u6587\u4ef6\u592a\u5927,\u8bbe\u7f6e\u5982\u4e0b:\u901a\u8fc7\u4ee5\u4e0b\u7701\u4e0b.<\/p>\n<p>ErrorLog &#8220;| \/usr\/local\/apache\/bin\/rotatelogs \/home\/apache_log\/www.gsmn.com.cn\/%Y_%m_%d_error_log 86400 480&#8221;<br \/>CustomLog &#8220;| \/usr\/local\/apache\/bin\/rotatelogs \/home\/apache_log\/www.gsmn.com.cn\/%Y_%m_%d_access_log 86400 480&#8221; common<\/p>\n<p>-=&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Linux\u7cfb\u7edf\u914d\u7f6e\u65b9\u6cd5<br \/>\u5728apache\u7684\u914d\u7f6e\u6587\u4ef6httpd.conf\u4e2d\u627e\u5230<br \/>ErrorLog logs\/error_log<br \/>CustomLog logs\/access_log common<\/p>\n<p>\u5c06\u5176\u6539\u4e3a<br \/>ErrorLog &#8220;| \/usr\/local\/apache\/bin\/rotatelogs \/home\/logs\/www\/%Y_%m_%d_error_log 86400 480&#8221;<br \/>CustomLog &#8220;| \/usr\/local\/apache\/bin\/rotatelogs \/home\/logs\/www\/%Y_%m_%d_access_log 86400 480&#8221; common<\/p>\n<p>#&nbsp;&nbsp; CustomLog &#8220;| \/usr\/local\/apache\/bin\/rotatelogs \/home\/apahcelog\/mnsch.com.cn_%Y_%m_%d_access_log 86400 480&#8221; common<\/p>\n<p>Windows\u7cfb\u7edf\u4e0b\u914d\u7f6e\u65b9\u6cd5\uff1a<br \/>\u5728apache\u7684\u914d\u7f6e\u6587\u4ef6httpd.conf\u4e2d\u627e\u5230<br \/>ErrorLog logs\/error_log<br \/>CustomLog logs\/access_log common<\/p>\n<p>\u5c06\u5176\u6539\u4e3a<br \/>ErrorLog &#8220;|c:\/apache\/bin\/rotatelogs.exe c:\/apache\/logs\/error_%Y_%m_%d.log 86400 480&#8221;<br \/>CustomLog &#8220;|c:\/apache\/bin\/rotatelogs.exe c:\/apache\/logs\/access_%Y_%m_%d.log 86400 480&#8221; common<br \/>\u5176\u4e2dc:\/apache\/\u662f\u4f60\u5b89\u88c5apache\u7684\u8def\u5f84<\/p>\n<p>\u9644rotatelogs\u8bf4\u660e<\/p>\n<p>rotatelogs logfile [ rotationtime [ offset ]] | [ filesizeM ]<\/p>\n<p>\u9009\u9879<br \/>logfile<br \/>\u5b83\u52a0\u4e0a\u57fa\u51c6\u540d\u5c31\u662f\u65e5\u5fd7\u6587\u4ef6\u540d\u3002\u5982\u679clogfile\u4e2d\u5305\u542b\u2019%&#8217;\uff0c\u5219\u5b83\u4f1a\u88ab\u89c6\u4e3a\u7528\u4e8e\u7684strftime(3)\u7684\u683c\u5f0f\u5b57\u4e32\uff1b\u5426\u5219\uff0c\u5b83\u4f1a\u88ab\u81ea\u52a8\u52a0\u4e0a\u4ee5\u79d2\u4e3a\u5355\u4f4d\u7684.nnnnnnnnnn\u540e\u7f00\u3002\u8fd9\u4e24\u79cd\u683c\u5f0f\u90fd\u8868\u793a\u65b0\u7684\u65e5\u5fd7\u5f00\u59cb\u4f7f\u7528\u7684\u65f6\u95f4\u3002<br \/>rotationtime<br \/>\u65e5\u5fd7\u6587\u4ef6\u56de\u5377\u7684\u4ee5\u79d2\u4e3a\u5355\u4f4d\u7684\u95f4\u9694\u65f6\u95f4<br \/>offset<br \/>\u76f8\u5bf9\u4e8eUTC\u7684\u65f6\u5dee\u7684\u5206\u949f\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u5047\u5b9a\u4e3a0\uff0c\u5e76\u4f7f\u7528UTC\u65f6\u95f4\u3002\u6bd4\u5982\uff0c\u8981\u6307\u5b9aUTC\u65f6\u5dee\u4e3a-5\u5c0f\u65f6\u7684\u5730\u533a\u7684\u5f53\u5730\u65f6\u95f4\uff0c\u5219\u6b64\u53c2\u6570\u5e94\u4e3a-300\u3002<br \/>filesizeM<br \/>\u6307\u5b9a\u56de\u5377\u65f6\u4ee5\u5146\u5b57\u8282\u4e3a\u5355\u4f4d\u7684\u540e\u7f00\u5b57\u6bcdM\u7684\u6587\u4ef6\u5927\u5c0f\uff0c\u800c\u4e0d\u662f\u6307\u5b9a\u56de\u5377\u65f6\u95f4\u6216\u65f6\u5dee\u3002<\/p>\n<p>\u4e0b\u5217\u65e5\u5fd7\u6587\u4ef6\u683c\u5f0f\u5b57\u4e32\u53ef\u4ee5\u4e3a\u6240\u6709\u7684strftime(3)\u5b9e\u73b0\u6240\u652f\u6301\uff0c\u89c1\u5404\u79cd\u6269\u5c55\u5e93\u5bf9\u5e94\u7684strftime(3)\u7684\u624b\u518c\u3002<br \/>%A \u661f\u671f\u540d\u5168\u79f0(\u672c\u5730\u7684)<br \/>%a 3\u4e2a\u5b57\u7b26\u7684\u661f\u671f\u540d(\u672c\u5730\u7684)<br \/>%B \u6708\u4efd\u540d\u7684\u5168\u79f0(\u672c\u5730\u7684)<br \/>%b 3\u4e2a\u5b57\u7b26\u7684\u6708\u4efd\u540d(\u672c\u5730\u7684)<br \/>%c \u65e5\u671f\u548c\u65f6\u95f4(\u672c\u5730\u7684)<br \/>%d 2\u4f4d\u6570\u7684\u4e00\u4e2a\u6708\u4e2d\u7684\u65e5\u671f\u6570<br \/>%H 2\u4f4d\u6570\u7684\u5c0f\u65f6\u6570(24\u5c0f\u65f6\u5236)<br \/>%I 2\u4f4d\u6570\u7684\u5c0f\u65f6\u6570(12\u5c0f\u65f6\u5236)<br \/>%j 3\u4f4d\u6570\u7684\u4e00\u5e74\u4e2d\u7684\u65e5\u671f\u6570<br \/>%M 2\u4f4d\u6570\u7684\u5206\u949f\u6570<br \/>%m 2\u4f4d\u6570\u7684\u6708\u4efd\u6570<br \/>%p am\/pm 12\u5c0f\u65f6\u5236\u7684\u4e0a\u4e0b\u5348(\u672c\u5730\u7684)<br \/>%S 2\u4f4d\u6570\u7684\u79d2\u6570<br \/>%U 2\u4f4d\u6570\u7684\u4e00\u5e74\u4e2d\u7684\u661f\u671f\u6570(\u661f\u671f\u5929\u4e3a\u4e00\u5468\u7684\u7b2c\u4e00\u5929)<br \/>%W 2\u4f4d\u6570\u7684\u4e00\u5e74\u4e2d\u7684\u661f\u671f\u6570(\u661f\u671f\u4e00\u4e3a\u4e00\u5468\u7684\u7b2c\u4e00\u5929)<br \/>%w 1\u4f4d\u6570\u7684\u661f\u671f\u51e0(\u661f\u671f\u5929\u4e3a\u4e00\u5468\u7684\u7b2c\u4e00\u5929)<br \/>%X \u65f6\u95f4 (\u672c\u5730\u7684)<br \/>%x \u65e5\u671f (\u672c\u5730\u7684)<br \/>%Y 4\u4f4d\u6570\u7684\u5e74\u4efd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>apahce\u65e5\u5fd7\u6587\u4ef6\u592a\u5927,\u8bbe\u7f6e\u5982\u4e0b:\u901a\u8fc7\u4ee5\u4e0b\u7701\u4e0b. ErrorLog&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-570","post","type-post","status-publish","format-standard","hentry","category-NetOS"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=570"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}