{"id":265870,"date":"2023-03-02T14:07:07","date_gmt":"2023-03-02T06:07:07","guid":{"rendered":"https:\/\/lrxjmw.cn\/zwlrzxtglyrh.html"},"modified":"2023-03-02T14:07:07","modified_gmt":"2023-03-02T06:07:07","slug":"zwlrzxtglyrh","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/zwlrzxtglyrh.html","title":{"rendered":"\u638c\u63e1Linux\u65e5\u5fd7\u7cfb\u7edf\uff1a\u7ba1\u7406\u5458\u5982\u4f55\u9ad8\u6548\u67e5\u627e\u4e0e\u5206\u6790\u65e5\u5fd7\u6587\u4ef6\uff1f"},"content":{"rendered":"
\u4f5c\u4e3a\u4e00\u540d\u7cfb\u7edf<\/a>\u7ba1\u7406\u5458\uff0c\u4f60\u662f\u5426\u66fe\u7ecf\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u60c5\u51b5\uff1a\u7a81\u7136\u53d1\u73b0\u670d\u52a1\u5668\u51fa\u73b0\u4e86\u95ee\u9898\uff0c\u4f46\u5374\u65e0\u4ece\u4e0b\u624b\u627e\u5230\u6839\u672c\u539f\u56e0\u3002\u8fd9\u65f6\u5019\uff0cLinux<\/a>\u65e5\u5fd7\u7cfb\u7edf\u5c31\u80fd\u591f\u4e3a\u4f60\u63d0\u4f9b\u91cd\u8981\u7684\u5e2e\u52a9\u3002<\/p>\n Linux\u65e5\u5fd7\u7cfb\u7edf\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u8ffd\u8e2a\u670d\u52a1\u5668\u4e0a\u53d1\u751f\u7684\u5404\u79cd\u4e8b\u4ef6linux\u670d\u52a1\u5668\u7ef4\u62a4\uff0c\u5305\u62ec\u767b\u5f55\u3001\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u3001\u7cfb\u7edf\u5d29\u6e83\u7b49\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u8bb0\u5f55\u6240\u6709\u4e8b\u4ef6linux\u65e5\u5fd7\u7cfb\u7edf<\/strong>\uff0c\u8fd8\u53ef\u4ee5\u5c06\u8fd9\u4e9b\u4e8b\u4ef6\u5f52\u7c7b\u5e76\u5b58\u50a8\u5728\u4e00\u4e2a\u6216\u591a\u4e2a\u6587\u4ef6\u4e2d\uff0c\u4ee5\u4fbf\u540e\u7eed\u5206\u6790\u3002<\/p>\n \u5728Linux\u4e2d\uff0c\u4e3b\u8981\u6709\u4e24\u79cd\u7c7b\u578b\u7684\u65e5\u5fd7\uff1a\u5185\u6838\u65e5\u5fd7\u548c\u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7\u3002\u5185\u6838\u65e5\u5fd7\u7531\u5185\u6838\u7ba1\u7406\u5e76\u8bb0\u5f55linux\u901a\u914d\u7b26\uff0c\u800c\u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7\u5219\u7531\u6bcf\u4e2a\u5e94\u7528\u7a0b\u5e8f\u81ea\u5df1\u7ba1\u7406\u5e76\u8bb0\u5f55\u3002\u5bf9\u4e8e\u7cfb\u7edf\u7ba1\u7406\u5458\u6765\u8bf4\uff0c\u6700\u91cd\u8981\u7684\u662f\u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7\u3002<\/p>\n \u5728Linux\u4e2d\uff0c\u5e94\u7528\u7a0b\u5e8f\u901a\u5e38\u4f7f\u7528syslogd\u670d\u52a1\u6765\u8bb0\u5f55\u65e5\u5fd7\u3002syslogd\u670d\u52a1\u4f1a\u5c06\u6240\u6709\u5e94\u7528\u7a0b\u5e8f\u751f\u6210\u7684\u65e5\u5fd7\u6d88\u606f\u53d1\u9001\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u5e76\u6839\u636e\u6d88\u606f\u7c7b\u578b\u8fdb\u884c\u5206\u7c7b\u3002\u8fd9\u4e9b\u6d88\u606f\u7c7b\u578b\u5305\u62ecDEBUG\u3001INFO\u3001WARNING\u548cERROR\u7b49\u7ea7\u3002<\/p>\n \u9664\u4e86syslogd\u670d\u52a1\u4e4b\u5916\uff0c\u8fd8\u6709\u4e00\u4e9b\u5176\u4ed6\u7684\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5206\u6790\u548c\u7ba1\u7406\u65e5\u5fd7\u6587\u4ef6\u3002\u4f8b\u5982\uff1a<\/p>\n <\/p>\n 1. logrotate\uff1a\u5b83\u53ef\u4ee5\u8f7b\u677e\u5730\u7ba1\u7406\u548c\u538b\u7f29\u591a\u4e2a\u65e5\u5fd7\u6587\u4ef6\uff0c\u5e76\u901a\u8fc7cron\u4efb\u52a1\u81ea\u52a8\u8fd0\u884c\u3002<\/p>\n 2. grep\uff1a\u5b83\u53ef\u4ee5\u641c\u7d22\u6307\u5b9a\u5173\u952e\u5b57\u6216\u6a21\u5f0f\uff0c\u5e76\u8f93\u51fa\u5339\u914d\u7ed3\u679c\u3002<\/p>\n 3. tail\uff1a\u5b83\u53ef\u4ee5\u5b9e\u65f6\u76d1\u63a7\u6307\u5b9a\u6587\u4ef6\u7684\u53d8\u5316\uff0c\u5e76\u8f93\u51fa\u65b0\u589e\u5185\u5bb9\u3002<\/p>\n 4. awk\uff1a\u5b83\u53ef\u4ee5\u89e3\u6790\u6587\u672c\u6570\u636e\uff0c\u5e76\u8f93\u51fa\u6307\u5b9a\u5b57\u6bb5\u6216\u884c\u3002<\/p>\n