{"id":51851,"date":"2024-12-03T10:27:18","date_gmt":"2024-12-03T02:27:18","guid":{"rendered":"https:\/\/fwq.ai\/blog\/51851\/"},"modified":"2024-12-03T10:27:18","modified_gmt":"2024-12-03T02:27:18","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8linux%e4%b8%8a%e9%85%8d%e7%bd%aesyslog%e5%ae%9e%e7%8e%b0%e6%97%a5%e5%bf%97%e8%bd%ac%e5%8f%91","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/51851\/","title":{"rendered":"\u5982\u4f55\u5728Linux\u4e0a\u914d\u7f6esyslog\u5b9e\u73b0\u65e5\u5fd7\u8f6c\u53d1"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u5728Linux\u4e0a\u914d\u7f6esyslog\u5b9e\u73b0\u65e5\u5fd7\u8f6c\u53d1<\/h1>\n<p>\u4e00\u5206\u8015\u8018\uff0c\u4e00\u5206\u6536\u83b7\uff01\u65e2\u7136\u90fd\u6253\u5f00\u8fd9\u7bc7<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5982\u4f55\u5728Linux\u4e0a\u914d\u7f6esyslog\u5b9e\u73b0\u65e5\u5fd7\u8f6c\u53d1\u300b<\/span>\uff0c\u5c31\u575a\u6301\u770b\u4e0b\u53bb\uff0c\u5b66\u4e0b\u53bb\u5427\uff01\u672c\u6587\u4e3b\u8981\u4f1a\u7ed9\u5927\u5bb6\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u5927\u5bb6\u5bf9\u672c\u6587\u6709\u597d\u7684\u5efa\u8bae\u6216\u8005\u770b\u5230\u6709\u4e0d\u8db3\u4e4b\u5904\uff0c\u975e\u5e38\u6b22\u8fce\u5927\u5bb6\u79ef\u6781\u63d0\u51fa\uff01\u5728\u540e\u7eed\u6587\u7ae0\u6211\u4f1a\u7ee7\u7eed\u66f4\u65b0<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u90fd\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<h4>\u4e00\u3001syslog\u534f\u8bae<\/h4>\n<p><strong>&nbsp; &nbsp; &nbsp;&nbsp;<\/strong>linux\u7cfb\u7edf\u4e2d\u5927\u90e8\u5206\u65e5\u5fd7\u662f\u901a\u8fc7\u4e00\u79cdsyslog\u673a\u5236\u4ea7\u751f\u548c\u7ef4\u62a4\u7684\u3002syslog\u662f\u4e00\u79cd\u534f\u8bae\uff0c\u5206\u4e3a\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u7aef\u3002\u5ba2\u6237\u7aef\u4ea7\u751f\u65e5\u5fd7\uff0c\u670d\u52a1\u5668\u7aef\u63a5\u6536\u65e5\u5fd7\u3002\u5e76\u5bf9\u63a5\u6536\u7684\u65e5\u5fd7\u505a\u51fa\u4fdd\u5b58\u5230\u6587\u4ef6\u6216\u5176\u4ed6\u65b9\u5f0f\u7684\u5904\u7406\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp;\u5728linux\u4e2d\uff0c\u5e38\u89c1syslog\u670d\u52a1\u5668\u7aef\u7a0b\u5e8f\u662fsyslogd\u5b88\u62a4\u8fdb\u7a0b\u3002\u8fd9\u4e2a\u7a0b\u5e8f\u4ece\u4e09\u4e2a\u5730\u65b9\u63a5\u6536\u65e5\u5fd7<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u30101\u3011: unix\u57df\u5957\u63a5\u5b57 \/dev\/log<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u30102\u3011\uff1audp\u7aef\u53e3514<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u30103\u3011\uff1a\u7279\u6b8a\u7684\u8bbe\u5907 \/dev\/klog<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u76f8\u5e94\u7684\uff0c\u4ea7\u751f\u65e5\u5fd7\u7684\u6d88\u606f\u7684\u7a0b\u5e8f\u5c31\u9700\u8981\u901a\u8fc7\u4e0a\u8ff0\u4e09\u79cd\u65b9\u5f0f\u5199\u5165\u6d88\u606f\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u7a0b\u5e8f\u800c\u8a00\u5c31\u662f\u5411\/dev\/log\u8fd9\u4e2a\u5957\u63a5\u5b57\u53d1\u9001\u65e5\u5fd7\u6d88\u606f\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u5728unix\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0csyslog\u5e7f\u6cdb\u7528\u4e8e\u7cfb\u7edf\u65e5\u5fd7\u3002syslog\u65e5\u5fd7\u6d88\u606f\u65e2\u53ef\u4ee5\u8bb0\u5f55\u5728\u672c\u5730\u6587\u4ef6\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7f51\u7edc\u53d1\u9001\u5230syslog\u7684\u670d\u52a1\u5668\u3002\u63a5\u6536syslog\u7684\u670d\u52a1\u5668\u53ef\u4ee5\u5bf9\u591a\u4e2a\u8bbe\u5907\u7684syslog\u6d88\u606f\u8fdb\u884c\u7edf\u4e00\u5b58\u50a8\u3002\u6216\u8005\u89e3\u6790\u5176\u4e2d\u7684\u5185\u5bb9\u505a\u76f8\u5e94\u7684\u5904\u7406\u3002\u5e38\u89c1\u7684\u5e94\u7528\u573a\u666f\u662f\u7f51\u7edc\u7ba1\u7406\u5de5\u5177\uff0c\u5b89\u5168\u7ba1\u7406\u7cfb\u7edf\uff0c\u65e5\u5fd7\u7ba1\u7406\u7cfb\u7edf\u3002 \u5b8c\u6574\u7684syslog\u65e5\u5fd7\u5305\u542b<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30101\u3011\uff1a\u4ea7\u751f\u65e5\u5fd7\u7684\u7a0b\u5e8f\u6a21\u5757<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30102\u3011\uff1a\u4e25\u91cd\u6027<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30103\u3011\uff1a\u65f6\u95f4<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30104\u3011\uff1a\u4e3b\u673a\u540d\u6216IP<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30105\u3011\uff1a\u8fdb\u7a0b\u540d<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30106\u3011\uff1a\u8fdb\u7a0bID<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30107\u3011\uff1a\u6b63\u6587<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u57282001\u5e74\u5b9a\u4e49\u7684RFC3164\u4e2d\uff0c\u63cf\u8ff0\u4e86BSD syslog\u534f\u8bae\uff1ahttp:\/\/www.ietf.org\/rfc\/rfc3164.txt\uff0c\u4e0d\u8fc7\u8fd9\u4e2a\u89c4\u8303\u7684\u5f88\u591a\u5185\u5bb9\u90fd\u4e0d\u662f\u5f3a\u5236\u6027\u7684\uff0c\u5e38\u5e38\u662f\u201c\u5efa\u8bae\u201d\u6216\u8005\u201c\u7ea6\u5b9a\u201d\uff0c\u4e5f\u7531\u4e8e\u8fd9\u4e2a\u89c4\u8303\u51fa\u7684\u6bd4\u8f83\u665a\uff0c\u5f88\u591a\u8bbe\u5907\u5e76\u4e0d\u9075\u5b88\u6216\u4e0d\u5b8c\u5168\u9075\u5b88\u8fd9\u4e2a\u89c4\u8303\u3002\u63a5\u4e0b\u6765\u5c31\u4ecb\u7ecd\u4e00 \u4e0b\u8fd9\u4e2a\u89c4\u8303\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp;\u7ea6\u5b9a\u53d1\u9001syslog\u7684\u8bbe\u5907\u4e3aDevice\uff0c\u8f6c\u53d1syslog\u7684\u8bbe\u5907\u4e3aRelay\uff0c\u63a5\u6536syslog\u7684\u8bbe\u5907\u4e3aCollector\u3002Relay\u672c\u8eab\u4e5f\u53ef\u4ee5\u53d1\u9001\u81ea\u8eab\u7684syslog\u7ed9Collector\uff0c\u8fd9\u4e2a\u65f6\u5019\u5b83\u8868\u73b0\u4e3a\u4e00\u4e2aDevice\u3002Relay\u4e5f\u53ef\u4ee5\u53ea\u8f6c\u53d1\u90e8\u5206\u63a5\u6536\u5230\u7684syslog\u6d88\u606f\uff0c\u8fd9\u4e2a\u65f6\u5019\u5b83\u540c\u65f6\u8868\u73b0\u4e3aRelay\u548cCollector\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp;syslog\u6d88\u606f\u53d1\u9001\u5230Collector\u7684UDP 514\u7aef\u53e3\uff0c\u4e0d\u9700\u8981\u63a5\u6536\u65b9\u5e94\u7b54\uff0cRFC3164\u5efa\u8bae Device \u4e5f\u4f7f\u7528514\u4f5c\u4e3a\u6e90\u7aef\u53e3\u3002\u89c4\u5b9asyslog\u6d88\u606f\u7684UDP\u62a5\u6587\u4e0d\u80fd\u8d85\u8fc71024\u5b57\u8282\uff0c\u5e76\u4e14\u5168\u90e8\u7531\u53ef\u6253\u5370\u7684\u5b57\u7b26\u7ec4\u6210\u3002\u5b8c\u6574\u7684syslog\u6d88\u606f\u75313\u90e8\u5206\u7ec4\u6210\uff0c\u5206\u522b\u662fPRI\u3001HEADER\u548cMSG\u3002\u5927\u90e8\u5206syslog\u90fd\u5305\u542bPRI\u548cMSG\u90e8\u5206\uff0c\u800cHEADER\u53ef\u80fd\u6ca1\u6709\u3002<\/p>\n<h4>\u4e8c\u3001\u914d\u7f6esyslog\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\uff0c\u5b9e\u73b0\u65e5\u5fd7\u8f6c\u53d1<\/h4>\n<p><strong>&nbsp; &nbsp; &nbsp; \u73af\u5883\uff1aubantu16.04<\/strong><\/p>\n<p><strong>&nbsp; &nbsp; &nbsp;1\u3001\u670d\u52a1\u7aef<\/strong><\/p>\n<p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;1&gt; \u4fee\u6539\/etc\/default\/rsyslog<\/strong><\/p>\n<p><strong>&nbsp; &nbsp; <\/strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong> &gt;&nbsp;\u4fee\u6539\/etc\/sysconf\/syslog \u4fee\u6539SYSLOGD_OPTIONS\u4e3a &#8220;-r -x -m 0&#8221;&nbsp;<\/strong><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -r\u8868\u793a\u5141\u8bb8\u63a5\u6536\u5916\u6765\u7684\u6d88\u606f<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -x\u8868\u793a\u4e0d\u89e3\u6790DNS,<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -m 0\u8868\u793a\u65f6\u95f4\u6233\u6807\u8bb0\u95f4\u9694,<\/p>\n<p><strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<\/strong>\u5982\u679c\u6307\u5b9a\u53ea\u63a5\u53d7\u67d0\u4e2a\u6216\u591a\u4e2aip\u8fc7\u6765\u7684\u65e5\u5fd7\uff0c\u4f8b&#8221;-s 168.1.1.1:168.1.1.2&#8243;<\/p>\n<p>&nbsp;<strong> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt; \u4fee\u6539\/etc\/rsyslog.conf<\/strong><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u53d6\u6d88\u6ce8\u91ca\uff1a<\/p>\n<pre>$ModLoad&nbsp;imudp.so\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$UDPServerRun&nbsp;514<\/pre>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u8fd9\u4e24\u53e5<\/p>\n<pre>syslog.info;syslog.!err;syslog.!crit;syslog.!alert&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/var\/log\/mylog&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#info\u4fe1\u606f\u8bb0\u5f55\u5230\u65e5\u5fd7\u670d\u52a1\u5668\u7684\/var\/log\/mylog\u4e2d\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;syslog.err&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/var\/log\/testerror&nbsp;&nbsp;&nbsp;&nbsp;#error\u4fe1\u606f\u8bb0\u5f55\u5230\u65e5\u5fd7\u670d\u52a1\u5668\u7684\/var\/log\/testerror\u4e2d&nbsp;&nbsp;2&nbsp;\u3001\u5ba2\u6237\u7aef<\/pre>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\u4fee\u6539\/etc\/syslog.conf&nbsp; \u6dfb\u52a0<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u53d6\u6d88\u6ce8\u91ca\uff1a<\/p>\n<pre>$ModLoad&nbsp;imudp.so\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$UDPServerRun&nbsp;514<\/pre>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u5728\u672b\u5c3e\u589e\u52a0\u8fd9\u4e24\u53e5<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;syslog.info &nbsp; @IP\uff08IP\u4e3a\u670d\u52a1\u7aefIP\u5730\u5740\uff09<\/p>\n<p><strong>3\u3001\u670d\u52a1\u91cd\u542f<\/strong><\/p>\n<p><strong>4\u3001\u6d4b\u8bd5<\/strong><\/p>\n<p><strong>&nbsp; \u5728\u5ba2\u6237\u7aef\u8fd0\u884c\u4e0b\u9762\u4ee3\u7801\uff0c\u53ef\u5728\u670d\u52a1\u7aef\/var\/log\/mylog\u4e2d\u770b\u5230\u65e5\u5fd7\u5df2\u7ecf\u5b58\u5165\u5230\u670d\u52a1\u7aef<\/strong><\/p>\n<pre>#include&nbsp;&lt;stdio.h&gt;\n#include&nbsp;&lt;syslog.h&gt;\nint&nbsp;main(int&nbsp;argc,&nbsp;char*&nbsp;argv[])\n{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/openlog(argv[0],&nbsp;LOG_CONS&nbsp;|&nbsp;LOG_PID,&nbsp;LOG_USER);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;count&nbsp;=&nbsp;0;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(count&lt;5){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;syslog(LOG_SYSLOG|LOG_INFO,&nbsp;\"%d:,&nbsp;syslog&nbsp;user&nbsp;test\",&nbsp;count);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count++;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/closelog();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;0;\n}<\/pre>\n<p>\u7ec8\u4e8e\u4ecb\u7ecd\u5b8c\u5566\uff01\u5c0f\u4f19\u4f34\u4eec\uff0c\u8fd9\u7bc7\u5173\u4e8e\u300a\u5982\u4f55\u5728Linux\u4e0a\u914d\u7f6esyslog\u5b9e\u73b0\u65e5\u5fd7\u8f6c\u53d1\u300b\u7684\u4ecb\u7ecd\u5e94\u8be5\u8ba9\u4f60\u6536\u83b7\u591a\u591a\u4e86\u5427\uff01\u6b22\u8fce\u5927\u5bb6\u6536\u85cf\u6216\u5206\u4eab\u7ed9\u66f4\u591a\u9700\u8981\u5b66\u4e60\u7684\u670b\u53cb\u5427~\u7c73\u4e91\u516c\u4f17\u53f7\u4e5f\u4f1a\u53d1\u5e03\u6587\u7ae0\u76f8\u5173\u77e5\u8bc6\uff0c\u5feb\u6765\u5173\u6ce8\u5427\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728Linux\u4e0a\u914d\u7f6esyslog\u5b9e\u73b0\u65e5\u5fd7\u8f6c\u53d1 \u4e00\u5206\u8015\u8018\uff0c\u4e00\u5206\u6536\u83b7\uff01\u65e2\u7136\u90fd\u6253\u5f00\u8fd9\u7bc7\u300a\u5982\u4f55\u5728Linux\u4e0a\u914d\u7f6esyslog\u5b9e\u73b0\u65e5\u5fd7\u8f6c\u53d1\u300b\uff0c\u5c31\u575a\u6301\u770b\u4e0b\u53bb\uff0c\u5b66\u4e0b\u53bb\u5427\uff01\u672c\u6587\u4e3b\u8981\u4f1a\u7ed9\u5927\u5bb6\u8bb2\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u5927\u5bb6\u5bf9\u672c\u6587\u6709\u597d\u7684\u5efa\u8bae\u6216\u8005\u770b\u5230\u6709\u4e0d\u8db3\u4e4b\u5904\uff0c\u975e\u5e38\u6b22\u8fce\u5927\u5bb6\u79ef\u6781\u63d0\u51fa\uff01\u5728\u540e\u7eed\u6587\u7ae0\u6211\u4f1a\u7ee7\u7eed\u66f4\u65b0\u6587\u7ae0\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u90fd\u6709\u6240\u5e2e\u52a9\uff01 \u4e00\u3001syslog\u534f\u8bae &nbsp; &nbsp; &nbsp;&nbsp;linux\u7cfb\u7edf\u4e2d\u5927\u90e8\u5206\u65e5\u5fd7\u662f\u901a\u8fc7\u4e00\u79cdsyslog\u673a\u5236\u4ea7\u751f\u548c\u7ef4\u62a4\u7684\u3002syslog\u662f\u4e00\u79cd\u534f\u8bae\uff0c\u5206\u4e3a\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u7aef\u3002\u5ba2\u6237\u7aef\u4ea7\u751f\u65e5\u5fd7\uff0c\u670d\u52a1\u5668\u7aef\u63a5\u6536\u65e5\u5fd7\u3002\u5e76\u5bf9\u63a5\u6536\u7684\u65e5\u5fd7\u505a\u51fa\u4fdd\u5b58\u5230\u6587\u4ef6\u6216\u5176\u4ed6\u65b9\u5f0f\u7684\u5904\u7406\u3002 &nbsp; &nbsp; &nbsp; &nbsp;\u5728linux\u4e2d\uff0c\u5e38\u89c1syslog\u670d\u52a1\u5668\u7aef\u7a0b\u5e8f\u662fsyslogd\u5b88\u62a4\u8fdb\u7a0b\u3002\u8fd9\u4e2a\u7a0b\u5e8f\u4ece\u4e09\u4e2a\u5730\u65b9\u63a5\u6536\u65e5\u5fd7 &nbsp; &nbsp; &nbsp; &nbsp; \u30101\u3011: unix\u57df\u5957\u63a5\u5b57 \/dev\/log &nbsp; &nbsp; &nbsp; &nbsp; \u30102\u3011\uff1audp\u7aef\u53e3514 &nbsp; &nbsp; &nbsp; &nbsp; \u30103\u3011\uff1a\u7279\u6b8a\u7684\u8bbe\u5907 \/dev\/klog &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u76f8\u5e94\u7684\uff0c\u4ea7\u751f\u65e5\u5fd7\u7684\u6d88\u606f\u7684\u7a0b\u5e8f\u5c31\u9700\u8981\u901a\u8fc7\u4e0a\u8ff0\u4e09\u79cd\u65b9\u5f0f\u5199\u5165\u6d88\u606f\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u7a0b\u5e8f\u800c\u8a00\u5c31\u662f\u5411\/dev\/log\u8fd9\u4e2a\u5957\u63a5\u5b57\u53d1\u9001\u65e5\u5fd7\u6d88\u606f\u3002 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u5728unix\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0csyslog\u5e7f\u6cdb\u7528\u4e8e\u7cfb\u7edf\u65e5\u5fd7\u3002syslog\u65e5\u5fd7\u6d88\u606f\u65e2\u53ef\u4ee5\u8bb0\u5f55\u5728\u672c\u5730\u6587\u4ef6\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7f51\u7edc\u53d1\u9001\u5230syslog\u7684\u670d\u52a1\u5668\u3002\u63a5\u6536syslog\u7684\u670d\u52a1\u5668\u53ef\u4ee5\u5bf9\u591a\u4e2a\u8bbe\u5907\u7684syslog\u6d88\u606f\u8fdb\u884c\u7edf\u4e00\u5b58\u50a8\u3002\u6216\u8005\u89e3\u6790\u5176\u4e2d\u7684\u5185\u5bb9\u505a\u76f8\u5e94\u7684\u5904\u7406\u3002\u5e38\u89c1\u7684\u5e94\u7528\u573a\u666f\u662f\u7f51\u7edc\u7ba1\u7406\u5de5\u5177\uff0c\u5b89\u5168\u7ba1\u7406\u7cfb\u7edf\uff0c\u65e5\u5fd7\u7ba1\u7406\u7cfb\u7edf\u3002 \u5b8c\u6574\u7684syslog\u65e5\u5fd7\u5305\u542b &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30101\u3011\uff1a\u4ea7\u751f\u65e5\u5fd7\u7684\u7a0b\u5e8f\u6a21\u5757 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u30102\u3011\uff1a\u4e25\u91cd\u6027 &nbsp; &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-51851","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/51851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=51851"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/51851\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=51851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=51851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=51851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}