{"id":451,"date":"2013-09-18T19:42:19","date_gmt":"2013-09-18T19:42:19","guid":{"rendered":"https:\/\/shan.info\/new\/linux%e4%b8%8b%e5%a6%82%e6%9e%9c-var-log-messages%e5%81%9c%e6%ad%a2%e5%af%ab%e5%85%a5%e5%85%a7%e5%ae%b9%e4%ba%86%ef%bc%8c%e5%a6%82%e4%bd%95%e9%87%8d%e6%96%b0%e5%95%9f%e5%8b%95syslogd\/"},"modified":"2013-09-18T19:42:19","modified_gmt":"2013-09-18T19:42:19","slug":"linux%e4%b8%8b%e5%a6%82%e6%9e%9c-var-log-messages%e5%81%9c%e6%ad%a2%e5%af%ab%e5%85%a5%e5%85%a7%e5%ae%b9%e4%ba%86%ef%bc%8c%e5%a6%82%e4%bd%95%e9%87%8d%e6%96%b0%e5%95%9f%e5%8b%95syslogd","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/linux%e4%b8%8b%e5%a6%82%e6%9e%9c-var-log-messages%e5%81%9c%e6%ad%a2%e5%af%ab%e5%85%a5%e5%85%a7%e5%ae%b9%e4%ba%86%ef%bc%8c%e5%a6%82%e4%bd%95%e9%87%8d%e6%96%b0%e5%95%9f%e5%8b%95syslogd\/","title":{"rendered":"Linux\u4e0b\u5982\u679c\/var\/log\/messages\u505c\u6b62\u5beb\u5165\u5167\u5bb9\u4e86\uff0c\u5982\u4f55\u91cd\u65b0\u555f\u52d5syslogd ."},"content":{"rendered":"<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; line-height: 18.1875px; background-color: #f5f7f7;\"># cd \/etc\/init.d<\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; line-height: 18.1875px; background-color: #f5f7f7;\"># .\/syslog restart<\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; line-height: 18.1875px; background-color: #f5f7f7;\">Shutting down kernel logger: OK ]<br \/>Shutting down system logger: OK ]<br \/>Starting system logger: OK ]<br \/>Starting kernel logger: OK ]<\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; line-height: 18.1875px; background-color: #f5f7f7;\">\u4e0d\u904e\u6700\u597d\u67e5\u8a62\u6e05\u695a\u662f\u70ba\u4ec0\u4e48\u4e0d\u80fd\u5beb\u5165linux os log\u7684 \uff1f<\/p>\n<p><br style=\"color: #333333; font-family: Arial, sans-serif; font-size: small; line-height: 18.1875px; background-color: #f5f7f7;\" \/><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; line-height: 18.1875px; background-color: #f5f7f7;\"><span style=\"font-size: x-small;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<table style=\"color: #333333; font-family: Arial, sans-serif; font-size: small; line-height: 18.1875px; background-color: #f5f7f7;\" border=\"0\">\n<tbody>\n<tr>\n<td><span style=\"font-size: x-small;\"><strong>\u65e5\u5fd7\u529f\u80fd<\/strong><br \/><\/span><\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"margin-top: 7px; margin-bottom: 7px;\"><span style=\"font-size: x-small;\">\u65e5\u5fd7(log)\u529f\u80fd\u7528\u4e8e\u5c06\u8def\u7531\u5668\u4ea7\u751f\u7684\u5404\u79cd\u4fe1\u606f\u4ee5\u65e5\u5fd7\u5f62\u5f0f\u8bb0\u5f55\u5230\u5177\u5907syslog\u529f\u80fd\u7684\u4e3b\u673a\u4e0a(\u5982unix\u4e3b\u673a)\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u8be5\u529f\u80fd\u7684\u7f3a\u7701\u5f62\u5f0f\u662f\u5c06\u4fe1\u606f\u663e\u793a\u5728\u8fde\u63a5console\u53e3\u7684\u7ec8\u7aef\u4e0a\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u4e00\u3001syslog\u529f\u80fd\u7b80\u4ecb<\/span><\/p>\n<p><span style=\"font-size: x-small;\">1\u3001unix\u4e3b\u673a\u7528syslogd\u8bb0\u5f55\u7cfb\u7edf\u4fe1\u606f\uff0c\u4fe1\u606f\u6765\u6e90\u5305\u62ec\uff1a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">1)\u7cfb\u7edf\u5185\u6838\u4ea7\u751f\u7cfb\u7edf\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">2)fifo\u7ba1\u9053\u8bb0\u5f55\u5185\u90e8\u8fdb\u7a0b\u901a\u4fe1\u7684\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">3)\u8fdb\u7a0b\u5c06\u4fe1\u606f\u901a\u8fc7socket\u8fde\u63a5\u5199\u5165\u5230log\u8bbe\u5907\u4e2d<\/span><\/p>\n<p><span style=\"font-size: x-small;\">4)\u8fdc\u7aef\u4e3b\u673a\u901a\u8fc7\u67d0\u79cd\u8fde\u63a5\u5c06\u4fe1\u606f\u8f93\u5165<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u5176\u4e2d\uff0c\u7b2c3\u9879\u4e0e\u672c\u8def\u7531\u5668syslog\u529f\u80fd\u6709\u5173\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">2\u3001unix\u5c06\u7cfb\u7edf\u4fe1\u606f\u4ee5\u67d0\u79cd\u5f62\u5f0f\u5206\u7c7b\u6216\u5206\u7ea7\uff0c\u8be5\u5f62\u5f0f\u53ef\u7406\u89e3\u4e3a\uff1a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">facility.level<\/span><\/p>\n<p><span style=\"font-size: x-small;\">facility\u4ee3\u8868\u4ea7\u751f\u4fe1\u606f\u7684\u6765\u6e90\uff0c\u5e38\u7528\u7684\u6709\u4ee5\u4e0b\u51e0\u9879\uff1a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">auth \u7528\u6237\u8eab\u4efd\u8ba4\u8bc1\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">authpriv \u7528\u6237\u6743\u9650\u8ba4\u8bc1\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">cron cron\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">daemon daemon\u8fdb\u7a0b\u4ea7\u751f\u7684\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">kern \u5185\u6838\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">local0~7 \u7cfb\u7edf\u7559\u7528<\/span><\/p>\n<p><span style=\"font-size: x-small;\">lpr \u6253\u5370\u961f\u5217\u4ea7\u751f\u7684\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">mail \u90ae\u4ef6\u7cfb\u7edf\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">news news\u7cfb\u7edf\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">user \u7528\u6237\u8fdb\u7a0b\u4ea7\u751f\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">uucp \u4e0euucp\u6709\u5173\u7684\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">syslog syslogd\u81ea\u8eab\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">level \u662f\u4fe1\u606f\u7684\u7ea7\u522b\uff0c\u4ee3\u8868\u7740\u5b50\u7cfb\u7edf\u5bf9\u8be5\u7ea7\u522b\u6216\u8be5\u7ea7\u522b\u4ee5\u4e0a\u7684\u4fe1\u606f\u6240\u8981\u91c7\u53d6\u7684\u63aa\u65bd\uff0c\u5e38\u7528\u7684\u67098\u9879<\/span><\/p>\n<p><span style=\"font-size: x-small;\">emerg \u7cfb\u7edf\u5931\u6548\uff0c\u7ea7\u522b\u6700\u9ad8<\/span><\/p>\n<p><span style=\"font-size: x-small;\">alert \u9700\u7acb\u5373\u4fee\u8865<\/span><\/p>\n<p><span style=\"font-size: x-small;\">crit \u60c5\u51b5\u4e25\u91cd\uff0c\u5982\u786c\u4ef6\u635f\u574f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">err \u9519\u8bef<\/span><\/p>\n<p><span style=\"font-size: x-small;\">warning \u8b66\u544a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">notice \u9700\u52a0\u4ee5\u6ce8\u610f\uff0c\u4f46\u65e0\u5173\u7d27\u8981<\/span><\/p>\n<p><span style=\"font-size: x-small;\">info \u666e\u901a\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">debug debug\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u4e8c\u3001config\u72b6\u6001\u4e0blog\u7684\u914d\u7f6e<\/span><\/p>\n<p><span style=\"font-size: x-small;\">logging\u547d\u4ee4\u6709\u5982\u4e0b\u547d\u4ee4\u9009\u9879<\/span><\/p>\n<p><span style=\"font-size: x-small;\">buffered &#8211; \u5c06\u65e5\u5fd7\u8bb0\u5f55\u4e8e\u5185\u90e8\u7f13\u51b2\u533a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">clear &#8211; \u6e05\u9664\u5185\u90e8\u65e5\u5fd7<\/span><\/p>\n<p><span style=\"font-size: x-small;\">console [ * ] &#8211; \u5c06\u65e5\u5fd7\u8bb0\u5f55\u4e8e\u7ec8\u7aef<\/span><\/p>\n<p><span style=\"font-size: x-small;\">facility &#8211; \u8bbe\u7f6esyslog\u7684\u7528\u9014<\/span><\/p>\n<p><span style=\"font-size: x-small;\">source-interface- \u8bbe\u7f6esyslog\u62a5\u6587\u7684\u6e90\u5730\u5740<\/span><\/p>\n<p><span style=\"font-size: x-small;\">trap &#8211; \u8bbe\u7f6e\u65e5\u5fd7\u8bb0\u5f55\u7684\u95e8\u9650<\/span><\/p>\n<p><span style=\"font-size: x-small;\">a.b.c.d &#8211; \u5c06\u65e5\u5fd7\u8bb0\u5f55\u4e8e\u652f\u6301syslog\u7684\u4e3b\u673a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u5176\u4e2d\uff0clogging console\u662f\u7f3a\u7701\u914d\u7f6e\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">1\u3001 logging buffered<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u4e8e\u5185\u90e8buffer\u4e2d\uff0c\u5229\u7528show logging\u547d\u4ee4\u53ef\u4ee5\u663e\u793abuffer\u4e2d\u7684log\u4fe1\u606f\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">2\u3001 logging clear<\/span><\/p>\n<p><span style=\"font-size: x-small;\">logging buffered\u7684\u76f8\u5173\u547d\u4ee4\uff0c\u7528\u4e8e\u6e05\u9664buffer\u4e2d\u7684log\u4fe1\u606f\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">3\u3001 logging console<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u7f3a\u7701\u914d\u7f6e\u4e3a\u5c06\u65e5\u5fd7\u4fe1\u606f\u663e\u793a\u4e8e\u76d1\u63a7\u7ec8\u7aef\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u76f8\u5173\u547d\u4ee4\u89c1terminal monitor enable\/disable<\/span><\/p>\n<p><span style=\"font-size: x-small;\">4\u3001 logging facility<\/span><\/p>\n<p><span style=\"font-size: x-small;\">logging facility ftp \u5728linux\u4e3b\u673a\u4e2d\u5c06\u65e5\u5fd7\u4fe1\u606f\u7684facility\u6807\u8bb0\u4e3aftp<\/span><\/p>\n<p><span style=\"font-size: x-small;\">logging facility nnn(0-255) \u4ece0\u5f00\u59cb\uff0c\u4f9d\u6b21\u5bf9\u5e94\u4e8e\u524d\u9762\u5404\u9879\uff0c\u5176\u4f59\u7559\u7528<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u5176\u5b83\u547d\u4ee4\u9009\u9879\u53c2\u89c1syslog\u529f\u80fd\u7b80\u4ecb<\/span><\/p>\n<p><span style=\"font-size: x-small;\">5\u3001logging source-interface<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u8bbe\u5b9asource-interface \u4e3alog\u4fe1\u606f\u62a5\u6587\u7684\u6e90\u53d1\u5730\u5740<\/span><\/p>\n<p><span style=\"font-size: x-small;\">6\u3001 logging trap&nbsp;<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u95e8\u9650\u8bbe\u5b9a\u53c2\u89c1syslog\u529f\u80fd\u7b80\u4ecb<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u4e00\u822c\u8bf4\u6765\uff0clog\u4fe1\u606f\u4e0b\u5217\u51e0\u5927\u7c7b<\/span><\/p>\n<p><span style=\"font-size: x-small;\">err \u6807\u8bb0\u8f6f\u4ef6\u9519\u8bef\u4fe1\u606f\u6216\u786c\u4ef6\u6545\u969c\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">notice \u6807\u8bb0\u7aef\u53e3up\/down\u7684\u53d8\u5316<\/span><\/p>\n<p><span style=\"font-size: x-small;\">info \u6807\u8bb0\u7cfb\u7edf\u91cd\u542f\u4fe1\u606f\u3001\u5305\u8fc7\u6ee4\u62a5\u6587\u8bb0\u5f55<\/span><\/p>\n<p><span style=\"font-size: x-small;\">debug \u6807\u8bb0debug\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">warning \u6807\u8bb0\u7528\u6237\u9a8c\u8bc1\u5931\u6548\u548c\u88ab\u5305\u8fc7\u6ee4\u7981\u6b62\u7684\u62a5\u6587\u8bb0\u5f55<\/span><\/p>\n<p><span style=\"font-size: x-small;\">nnn(0-7) \u4f9d\u6b21\u5bf9\u5e94\u4e8e\u524d\u9762\u5404\u9879\uff0c\u7ea7\u522b\u6700\u9ad8\u4e3a0\uff0c\u6700\u4f4e\u4e3a7<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u5728\u8bbe\u5b9a\u4e00\u4e2a\u7ea7\u522b\u4e4b\u540e\uff0c\u65e5\u5fd7\u5c06\u8bb0\u5f55\u8be5\u7ea7\u522b\u548c\u8be5\u7ea7\u522b\u4e4b\u4e0a\u7684log\u4fe1\u606f\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">7\u3001 logging a.b.c.d<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u5c06ip\u4e3aa.b.c.d\u7684\u4e3b\u673a\u4f5c\u4e3asyslog\u4e3b\u673a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u4e09\u3001\u76f8\u5173\u547d\u4ee4<\/span><\/p>\n<p><span style=\"font-size: x-small;\">1\u3001 terminal monitor enable\/disable<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u7f3a\u7701\u72b6\u6001\u4e0b\u4e3alogging console\u65f6\uff0c\u65e5\u5fd7\u4fe1\u606f(\u5305\u62ecdebug\u4fe1\u606f)\u53ea\u80fd\u5728\u76d1\u63a7\u7a97\u53e3\u663e\u793a\uff0c\u865a\u62df\u7ec8\u7aef\u4e0d\u80fd\u663e\u793a\uff0c\u8981\u4f7f\u5728\u865a\u62df\u7ec8\u7aef\u663e\u793alog\u4fe1\u606f\uff0c\u53ea\u9700\u5728config\u72b6\u6001\u4e0b\u952e\u5165\uff1a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">terminal monitor enable<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u53cd\u4e4b\uff0c\u8bbeterminal monitor disable<\/span><\/p>\n<p><span style=\"font-size: x-small;\">2\u3001\u9632\u706b\u5899\u5217\u8868\u4e2d\uff0c\u6bcf\u4e2a\u5217\u8868\u90fd\u53ef\u4ee5\u8bb0log\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: x-small;\">:\u5982\uff1aper add ip 2.2.2.2 255.0.0.0 1.1.1.1 255.0.0.0 log<\/span><\/p>\n<p><span style=\"font-size: x-small;\">3\u3001 show logging<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u663e\u793a\u8bb0\u5f55\u4e8ebuffer\u4e2d\u7684log\u4fe1\u606f<\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px;\"><span style=\"font-size: x-small;\">==========================================================<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color: #333333; font-size: small; line-height: 18.1875px; background-color: #f5f7f7; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u7cfb\u7edf\u8fd0\u884c\u65e5\u5fd7\uff1a<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: x-small;\"><strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">A<\/span><\/strong><strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u3001<\/span><\/strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">Linux&nbsp;<\/span><\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u65e5\u5fd7\u5b58\u50a8\u5728<span lang=\"EN-US\">&nbsp;\/var\/log&nbsp;<\/span>\u76ee\u5f55\u4e2d\u3002\u8fd9\u91cc\u6709\u51e0\u4e2a\u7531\u7cfb\u7edf\u7ef4\u62a4\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u4f46\u5176\u4ed6\u670d\u52a1\u548c\u7a0b\u5e8f\u4e5f\u53ef\u80fd\u4f1a\u628a\u5b83\u4eec\u7684\u65e5\u5fd7\u653e\u5728\u8fd9\u91cc\u3002\u5927\u591a\u6570\u65e5\u5fd7\u53ea\u6709<span lang=\"EN-US\">&nbsp;root&nbsp;<\/span>\u624d\u53ef\u4ee5\u8bfb\uff0c\u4e0d\u8fc7\u53ea\u9700\u8981\u4fee\u6539\u6587\u4ef6\u7684\u8bbf\u95ee\u6743\u9650\u5c31\u53ef\u4ee5\u8ba9\u5176\u4ed6\u4eba\u53ef\u8bfb\u3002<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u4ee5\u4e0b\u662f\u5e38\u7528\u7684\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\u540d\u79f0\u53ca\u5176\u63cf\u8ff0\uff1a<\/span><\/span><\/p>\n<ol style=\"list-style-type: lower-alpha;\">\n<li><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u8bb0\u5f55\u8f93\u51fa\u5230\u7cfb\u7edf\u4e3b\u63a7\u53f0\u4ee5\u53ca\u7531<span lang=\"EN-US\">syslog<\/span>\u7cfb\u7edf\u670d\u52a1\u7a0b\u5e8f\u4ea7\u751f\u7684\u6d88\u606f<\/span><\/span><\/li>\n<\/ol>\n<ol style=\"list-style-type: lower-roman;\">\n<li><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u6269\u5c55\u7684<\/span><span lang=\"EN-US\"><span style=\"font-size: x-small;\">utmp<\/span><\/span><\/span><\/li>\n<\/ol>\n<ol style=\"list-style-type: lower-alpha;\">\n<li><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u8bb0\u5f55\u6bcf\u4e00\u6b21\u7528\u6237\u767b\u5f55\u548c\u6ce8\u9500\u7684\u5386\u53f2\u4fe1\u606f\u6269\u5c55\u7684<\/span><span lang=\"EN-US\"><span style=\"font-size: x-small;\">wtmp<\/span><\/span><\/span><\/li>\n<\/ol>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: x-small;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">vold.log&nbsp;<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u8bb0\u5f55\u4f7f\u7528\u5916\u90e8\u4ecb\u8d28\u51fa\u73b0\u7684\u9519\u8bef<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\" align=\"left\"><strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u3001<span lang=\"EN-US\">\/var\/log\/messages<\/span><\/span><\/span><\/strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\"><br \/><span style=\"font-size: x-small;\">messages&nbsp;<\/span><\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u65e5\u5fd7\u662f\u6838\u5fc3\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\u3002\u5b83\u5305\u542b\u4e86\u7cfb\u7edf\u542f\u52a8\u65f6\u7684\u5f15\u5bfc\u6d88\u606f\uff0c\u4ee5\u53ca\u7cfb\u7edf\u8fd0\u884c\u65f6\u7684\u5176\u4ed6\u72b6\u6001\u6d88\u606f\u3002<span lang=\"EN-US\">IO&nbsp;<\/span>\u9519\u8bef\u3001\u7f51\u7edc\u9519\u8bef\u548c\u5176\u4ed6\u7cfb\u7edf\u9519\u8bef\u90fd\u4f1a\u8bb0\u5f55\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u3002\u5176\u4ed6\u4fe1\u606f\uff0c\u6bd4\u5982\u67d0\u4e2a\u4eba\u7684\u8eab\u4efd\u5207\u6362\u4e3a<span lang=\"EN-US\">&nbsp;root<\/span>\uff0c\u4e5f\u5728\u8fd9\u91cc\u5217\u51fa\u3002\u5982\u679c\u670d\u52a1\u6b63\u5728\u8fd0\u884c\uff0c\u6bd4\u5982<span lang=\"EN-US\">&nbsp;DHCP&nbsp;<\/span>\u670d\u52a1\u5668\uff0c\u60a8\u53ef\u4ee5\u5728<span lang=\"EN-US\">&nbsp;messages&nbsp;<\/span>\u6587\u4ef6\u4e2d\u89c2\u5bdf\u5b83\u7684\u6d3b\u52a8\u3002\u901a\u5e38\uff0c<span lang=\"EN-US\">\/var\/log\/messages&nbsp;<\/span>\u662f\u60a8\u5728\u505a\u6545\u969c\u8bca\u65ad\u65f6\u9996\u5148\u8981\u67e5\u770b\u7684\u6587\u4ef6\u3002<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\" align=\"left\"><strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u3001<span lang=\"EN-US\">\/var\/log\/XFree86.0.log<\/span><\/span><\/span><\/strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u8fd9\u4e2a\u65e5\u5fd7\u8bb0\u5f55\u7684\u662f<span lang=\"EN-US\">&nbsp;Xfree86 Xwindows&nbsp;<\/span>\u670d\u52a1\u5668\u6700\u540e\u4e00\u6b21\u6267\u884c\u7684\u7ed3\u679c\u3002\u5982\u679c\u60a8\u5728\u542f\u52a8\u5230\u56fe\u5f62\u6a21\u5f0f\u65f6\u9047\u5230\u4e86\u95ee\u9898\uff0c\u4e00\u822c\u60c5\u51b5\u4ece\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u4f1a\u627e\u5230\u5931\u8d25\u7684\u539f\u56e0\u3002<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\" align=\"left\"><span style=\"font-size: x-small;\"><strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">D<\/span><\/strong><strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u3001<\/span><\/strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u5728<span lang=\"EN-US\">\/var\/log&nbsp;<\/span>\u76ee\u5f55\u4e0b\u6709\u4e00\u4e9b\u6587\u4ef6\u4ee5\u4e00\u4e2a\u6570\u5b57\u7ed3\u5c3e\uff0c\u8fd9\u4e9b\u662f\u5df2\u8f6e\u5faa\u7684\u5f52\u6863\u6587\u4ef6\u3002\u65e5\u5fd7\u6587\u4ef6\u4f1a\u53d8\u5f97\u7279\u522b\u5927\uff0c\u7279\u522b\u7b28\u91cd\u3002<span lang=\"EN-US\">Linux&nbsp;<\/span>\u63d0\u4f9b\u4e86\u4e00\u4e2a\u547d\u4ee4\u6765\u8f6e\u5faa\u8fd9\u4e9b\u65e5\u5fd7\uff0c\u4ee5\u4f7f\u60a8\u7684\u5f53\u524d\u65e5\u5fd7\u4fe1\u606f\u4e0d\u4f1a\u6df9\u6ca1\u5728\u65e7\u7684\u65e0\u5173\u4fe1\u606f\u4e4b\u4e2d\u3002&nbsp;<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">logrotate<\/span><\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u901a\u5e38\u662f\u5b9a\u65f6\u81ea\u52a8\u8fd0\u884c\u7684\uff0c\u4f46\u662f\u4e5f\u53ef\u4ee5\u624b\u5de5\u8fd0\u884c\u3002\u5f53\u6267\u884c\u540e\uff0c<span lang=\"EN-US\">logrotate&nbsp;<\/span>\u5c06\u53d6\u5f97\u5f53\u524d\u7248\u672c\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u7136\u540e\u5728\u8fd9\u4e2a\u6587\u4ef6\u540d\u6700\u540e\u9644\u52a0\u4e00\u4e2a<span lang=\"EN-US\">\u201c.1\u201d<\/span>\u3002\u5176\u4ed6\u66f4\u65e9\u8f6e\u5faa\u7684\u6587\u4ef6\u4e3a<span lang=\"EN-US\">\u201c.2\u201d<\/span>\u3001<span lang=\"EN-US\">\u201c.3\u201d<\/span>\uff0c\u4f9d\u6b21\u7c7b\u63a8\u3002\u6587\u4ef6\u540d\u540e\u7684\u6570\u5b57\u8d8a\u5927\uff0c\u65e5\u5fd7\u5c31\u8d8a\u8001\u3002<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\" align=\"left\"><span style=\"font-size: x-small;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91<span lang=\"EN-US\">&nbsp;\/etc\/logrotate.conf&nbsp;<\/span>\u6587\u4ef6\u6765\u914d\u7f6e&nbsp;<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">logrotate<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u7684\u81ea\u52a8\u884c\u4e3a\u3002\u901a\u8fc7&nbsp;<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">man logrotate<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u6765\u5b66\u4e60&nbsp;<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">logrotate<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u7684\u5168\u90e8\u7ec6\u8282\u3002<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><strong><span style=\"font-size: 12pt; color: #ff6600; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u5176\u4e2d\uff1a<\/span><\/span><\/strong><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\"><span style=\"font-size: x-small;\"># rotate log files weekly<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\"><span style=\"font-size: x-small;\">weekly<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u8fd9\u91cc\u4ee3\u8868\u6bcf\u4e2a\u65e5\u5fd7\u6587\u4ef6\u662f\u6bcf\u4e2a\u661f\u671f\u5faa\u73af\u4e00\u6b21\uff0c\u4e00\u4e2a\u65e5\u5fd7\u6587\u4ef6\u4fdd\u5b58\u4e00\u4e2a\u661f\u671f\u7684\u5185\u5bb9\u3002<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\"><span style=\"font-size: x-small;\"># keep 4 weeks worth of backlogs<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\"><span style=\"font-size: x-small;\">rotate 4<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u8fd9\u91cc\u4ee3\u8868\u65e5\u5fd7\u5faa\u73af\u7684\u6b21\u6570\u662f<span lang=\"EN-US\">4<\/span>\u6b21\uff0c\u5373\u53ef\u4ee5\u4fdd\u5b58<span lang=\"EN-US\">4<\/span>\u4e2a\u65e5\u5fd7\u6587\u4ef6\u3002<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><strong>E\u3001<\/strong><span class=\"atitle21\">&nbsp;<\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91<span lang=\"EN-US\">&nbsp;\/et\/syslog.conf&nbsp;<\/span>\u548c<span lang=\"EN-US\">&nbsp;\/etc\/sysconfig\/syslog&nbsp;<\/span>\u6765\u914d\u7f6e\u5b83\u4eec\u7684\u884c\u4e3a\uff0c\u53ef\u4ee5\u5b9a\u5236\u7cfb\u7edf\u65e5\u5fd7\u7684\u5b58\u653e\u8def\u5f84\u548c\u65e5\u5fd7\u4ea7\u751f\u7ea7\u522b\u3002<\/span><\/span><\/p>\n<h3 style=\"font-family: Arial, sans-serif; line-height: 18.1875px; background-color: #f5f7f7;\">&nbsp;<\/h3>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; line-height: 16px;\"><strong><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\"><span style=\"font-size: x-small;\">last<\/span><\/span><\/strong><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; text-indent: 21pt; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\"><span style=\"font-size: x-small;\">\u5355\u72ec\u6267\u884c<span lang=\"EN-US\">last<\/span>\u6307\u4ee4\uff0c\u5b83\u4f1a\u8bfb\u53d6\u4f4d\u4e8e<span lang=\"EN-US\">\/var\/log<\/span>\u76ee\u5f55\u4e0b\uff0c\u540d\u79f0\u4e3a<span lang=\"EN-US\">wtmp<\/span>\u7684\u6587\u4ef6\uff0c\u5e76\u628a\u8be5\u7ed9\u6587\u4ef6\u7684\u5185\u5bb9\u8bb0\u5f55\u7684\u767b\u5165\u7cfb\u7edf\u7684\u7528\u6237\u540d\u5355\u5168\u90e8\u663e\u793a\u51fa\u6765\u3002<\/span><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; line-height: 16px;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\"><strong><span style=\"font-size: x-small;\">history<\/span><\/strong><\/span><\/p>\n<p style=\"margin-top: 7px; margin-bottom: 7px; color: #333333; font-family: Arial, sans-serif; font-size: small; background-color: #f5f7f7; line-height: 16px;\"><span style=\"font-size: x-small;\"><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\" lang=\"EN-US\">history<\/span><span style=\"font-size: 12pt; line-height: 20px; font-family: \u5b8b\u4f53;\">\u547d\u4ee4\u80fd\u591f\u4fdd\u5b58\u6700\u8fd1\u6240\u6267\u884c\u7684\u547d\u4ee4\u3002\u5982\u679c\u662f<span lang=\"EN-US\">root<\/span>\u547d\u4ee4\u6240\u4fdd\u5b58\u7684\u547d\u4ee4\u5185\u5bb9\u5728<span lang=\"EN-US\">\/root\/.bash_history<\/span>\u6587\u4ef6\u4e2d\uff0c\u5982\u679c\u662f\u666e\u901a\u7528\u6237\uff0c\u64cd\u4f5c\u6240\u547d\u4ee4\u4fdd\u5b58\u5728\u8fd9\u4e2a\u7528\u6237\u7684\u6240\u5c5e\u76ee\u5f55\u4e0b\uff0c\u5373\u4e00\u822c\u7684<span lang=\"EN-US\">\/home\/username\/.bash_history<\/span>\u3002\u8fd9\u4e2a<span lang=\"EN-US\">history<\/span>\u7684\u4fdd\u5b58\u503c\u53ef\u4ee5\u8bbe\u7f6e\uff0c\u7f16\u8f91<span lang=\"EN-US\">\/etc\/profile<\/span>\u6587\u4ef6\uff0c\u5176\u4e2d\u7684<span lang=\"EN-US\">HISTSIZE=1000<\/span>\u7684\u503c\u5c31\u662f<span lang=\"EN-US\">history<\/span>\u4fdd\u5b58\u7684\u503c\u3002<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p># cd \/etc\/init.d # .\/syslog restart Shutting down kernel logger: OK ]Shutting down system logger: OK ]Starting system logger: OK ]Starting kernel logger: OK ] \u4e0d\u904e\u6700\u597d\u67e5\u8a62\u6e05\u695a\u662f\u70ba\u4ec0\u4e48\u4e0d\u80fd\u5beb\u5165linux os log\u7684 \uff1f &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; \u65e5\u5fd7\u529f\u80fd \u65e5\u5fd7(log)\u529f\u80fd\u7528\u4e8e\u5c06\u8def\u7531\u5668\u4ea7\u751f\u7684\u5404\u79cd\u4fe1\u606f\u4ee5\u65e5\u5fd7\u5f62\u5f0f\u8bb0\u5f55\u5230\u5177\u5907syslog\u529f\u80fd\u7684\u4e3b\u673a\u4e0a(\u5982unix\u4e3b\u673a)\u3002 \u8be5\u529f\u80fd\u7684\u7f3a\u7701\u5f62\u5f0f\u662f\u5c06\u4fe1\u606f\u663e\u793a\u5728\u8fde\u63a5console\u53e3\u7684\u7ec8\u7aef\u4e0a\u3002 \u4e00\u3001syslog\u529f\u80fd\u7b80\u4ecb 1\u3001unix\u4e3b\u673a\u7528syslogd\u8bb0\u5f55\u7cfb\u7edf\u4fe1\u606f\uff0c\u4fe1\u606f\u6765\u6e90\u5305\u62ec\uff1a 1)\u7cfb\u7edf\u5185\u6838\u4ea7\u751f\u7cfb\u7edf\u4fe1\u606f 2)fifo\u7ba1\u9053\u8bb0\u5f55\u5185\u90e8\u8fdb\u7a0b\u901a\u4fe1\u7684\u4fe1\u606f 3)\u8fdb\u7a0b\u5c06\u4fe1\u606f\u901a\u8fc7socket\u8fde\u63a5\u5199\u5165\u5230log\u8bbe\u5907\u4e2d 4)\u8fdc\u7aef\u4e3b\u673a\u901a\u8fc7\u67d0\u79cd\u8fde\u63a5\u5c06\u4fe1\u606f\u8f93\u5165 \u5176\u4e2d\uff0c\u7b2c3\u9879\u4e0e\u672c\u8def\u7531\u5668syslog\u529f\u80fd\u6709\u5173\u3002 2\u3001unix\u5c06\u7cfb\u7edf\u4fe1\u606f\u4ee5\u67d0\u79cd\u5f62\u5f0f\u5206\u7c7b\u6216\u5206\u7ea7\uff0c\u8be5\u5f62\u5f0f\u53ef\u7406\u89e3\u4e3a\uff1a facility.level facility\u4ee3\u8868\u4ea7\u751f\u4fe1\u606f\u7684\u6765\u6e90\uff0c\u5e38\u7528\u7684\u6709\u4ee5\u4e0b\u51e0\u9879\uff1a auth \u7528\u6237\u8eab\u4efd\u8ba4\u8bc1\u4fe1\u606f authpriv \u7528\u6237\u6743\u9650\u8ba4\u8bc1\u4fe1\u606f cron cron\u4fe1\u606f daemon daemon\u8fdb\u7a0b\u4ea7\u751f\u7684\u4fe1\u606f kern \u5185\u6838\u4fe1\u606f local0~7 \u7cfb\u7edf\u7559\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-451","post","type-post","status-publish","format-standard","hentry","category-centos-6"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=451"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/451\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}