{"id":23924,"date":"2025-04-19T08:56:25","date_gmt":"2025-04-19T00:56:25","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/23924.html"},"modified":"2025-04-19T08:56:25","modified_gmt":"2025-04-19T00:56:25","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%af%b9%e5%90%8e%e5%8f%b0%e6%97%a5%e5%bf%97%e8%bf%9b%e8%a1%8c%e7%bc%96%e8%be%91","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/23924.html","title":{"rendered":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91"},"content":{"rendered":"<p>\u5728\u670d\u52a1\u5668\u4e0a\u7f16\u8f91\u540e\u53f0\u65e5\u5fd7\u6587\u4ef6\u53ef\u80fd\u5e26\u6765\u4e00\u4e9b\u597d\u5904&#xff0c;\u4f46\u8fd9\u4e9b\u597d\u5904\u901a\u5e38\u4f34\u968f\u7740\u98ce\u9669\u548c\u6311\u6218\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6f5c\u5728\u7684\u597d\u5904&#xff0c;\u4ee5\u53ca\u9700\u8981\u8003\u8651\u7684\u6ce8\u610f\u4e8b\u9879&#xff1a;<\/p>\n<h4>\u597d\u5904<\/h4>\n<li>\n<p>\u95ee\u9898\u8bca\u65ad&#xff1a;<\/p>\n<ul>\n<li>\u7f16\u8f91\u65e5\u5fd7\u53ef\u4ee5\u5e2e\u52a9\u5feb\u901f\u5b9a\u4f4d\u548c\u89e3\u51b3\u7d27\u6025\u95ee\u9898&#xff0c;\u4f8b\u5982&#xff0c;\u901a\u8fc7\u641c\u7d22\u7279\u5b9a\u7684\u9519\u8bef\u4ee3\u7801\u6216\u5f02\u5e38\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u65e5\u5fd7\u6e05\u7406&#xff1a;<\/p>\n<ul>\n<li>\u5220\u9664\u4e0d\u5fc5\u8981\u7684\u65e5\u5fd7\u6761\u76ee\u6216\u6e05\u7406\u65e7\u7684\u65e5\u5fd7\u8bb0\u5f55&#xff0c;\u4ee5\u8282\u7701\u78c1\u76d8\u7a7a\u95f4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u65e5\u5fd7\u5206\u6790&#xff1a;<\/p>\n<ul>\n<li>\u5bf9\u65e5\u5fd7\u8fdb\u884c\u683c\u5f0f\u5316\u6216\u7ed3\u6784\u5316\u5904\u7406&#xff0c;\u4f7f\u5176\u66f4\u5bb9\u6613\u88ab\u65e5\u5fd7\u5206\u6790\u5de5\u5177\u89e3\u6790\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u654f\u611f\u4fe1\u606f\u79fb\u9664&#xff1a;<\/p>\n<ul>\n<li>\u4ece\u65e5\u5fd7\u4e2d\u79fb\u9664\u654f\u611f\u4fe1\u606f&#xff0c;\u4ee5\u7b26\u5408\u6570\u636e\u4fdd\u62a4\u6cd5\u89c4\u548c\u5b89\u5168\u8981\u6c42\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u65e5\u5fd7\u5f52\u6863&#xff1a;<\/p>\n<ul>\n<li>\u7f16\u8f91\u65e5\u5fd7\u6587\u4ef6\u4ee5\u4fbf\u66f4\u597d\u5730\u8fdb\u884c\u5f52\u6863\u548c\u957f\u671f\u5b58\u50a8\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6027\u80fd\u4f18\u5316&#xff1a;<\/p>\n<ul>\n<li>\u901a\u8fc7\u5220\u9664\u6216\u5206\u5272\u5927\u578b\u65e5\u5fd7\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u63d0\u9ad8\u65e5\u5fd7\u6587\u4ef6\u7684\u5904\u7406\u901f\u5ea6\u548c\u670d\u52a1\u5668\u6027\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<h4>\u6ce8\u610f\u4e8b\u9879<\/h4>\n<p>\u5c3d\u7ba1\u6709\u4e0a\u8ff0\u597d\u5904&#xff0c;\u7f16\u8f91\u65e5\u5fd7\u6587\u4ef6\u4e5f\u5b58\u5728\u4e00\u4e9b\u6f5c\u5728\u7684\u98ce\u9669&#xff1a;<\/p>\n<li>\n<p>\u6570\u636e\u5b8c\u6574\u6027&#xff1a;<\/p>\n<ul>\n<li>\u4fee\u6539\u65e5\u5fd7\u6587\u4ef6\u53ef\u80fd\u4f1a\u7834\u574f\u6570\u636e\u7684\u5b8c\u6574\u6027&#xff0c;\u5f71\u54cd\u95ee\u9898\u6392\u67e5\u548c\u7cfb\u7edf\u76d1\u63a7\u7684\u6709\u6548\u6027\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5408\u89c4\u6027\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u5728\u67d0\u4e9b\u884c\u4e1a&#xff0c;\u65e5\u5fd7\u6587\u4ef6\u88ab\u89c6\u4e3a\u6cd5\u5f8b\u8bc1\u636e&#xff0c;\u672a\u7ecf\u6388\u6743\u7684\u4fee\u6539\u53ef\u80fd\u4f1a\u8fdd\u53cd\u5408\u89c4\u6027\u8981\u6c42\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5b89\u5168\u98ce\u9669&#xff1a;<\/p>\n<ul>\n<li>\u4e0d\u5f53\u7684\u65e5\u5fd7\u7f16\u8f91\u53ef\u80fd\u4f1a\u5f15\u5165\u5b89\u5168\u6f0f\u6d1e&#xff0c;\u6216\u8005\u88ab\u6076\u610f\u884c\u4e3a\u8005\u5229\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7ef4\u62a4\u96be\u5ea6&#xff1a;<\/p>\n<ul>\n<li>\u9891\u7e41\u7f16\u8f91\u65e5\u5fd7\u53ef\u80fd\u4f1a\u589e\u52a0\u7cfb\u7edf\u7ef4\u62a4\u7684\u590d\u6742\u6027\u548c\u96be\u5ea6\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u9519\u8bef\u64cd\u4f5c&#xff1a;<\/p>\n<ul>\n<li>\u9519\u8bef\u7684\u7f16\u8f91\u64cd\u4f5c\u53ef\u80fd\u5bfc\u81f4\u91cd\u8981\u6570\u636e\u4e22\u5931\u6216\u7cfb\u7edf\u4e0d\u7a33\u5b9a\u3002<\/li>\n<\/ul>\n<\/li>\n<h4>\u6700\u4f73\u5b9e\u8df5<\/h4>\n<p>\u4e3a\u4e86\u6700\u5927\u5316\u597d\u5904\u5e76\u6700\u5c0f\u5316\u98ce\u9669&#xff0c;\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5&#xff1a;<\/p>\n<li>\n<p>\u5907\u4efd&#xff1a;<\/p>\n<ul>\n<li>\u5728\u7f16\u8f91\u524d&#xff0c;\u59cb\u7ec8\u5907\u4efd\u539f\u59cb\u65e5\u5fd7\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5ba1\u8ba1\u548c\u76d1\u63a7&#xff1a;<\/p>\n<ul>\n<li>\u8bb0\u5f55\u6240\u6709\u5bf9\u65e5\u5fd7\u6587\u4ef6\u7684\u4fee\u6539\u64cd\u4f5c&#xff0c;\u4ee5\u4fbf\u4e8e\u5ba1\u8ba1\u548c\u76d1\u63a7\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6743\u9650\u63a7\u5236&#xff1a;<\/p>\n<ul>\n<li>\u9650\u5236\u5bf9\u65e5\u5fd7\u6587\u4ef6\u7684\u8bbf\u95ee\u6743\u9650&#xff0c;\u786e\u4fdd\u53ea\u6709\u6388\u6743\u4eba\u5458\u624d\u80fd\u8fdb\u884c\u7f16\u8f91\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u4e13\u4e1a\u5de5\u5177&#xff1a;<\/p>\n<ul>\n<li>\u5229\u7528\u4e13\u4e1a\u7684\u65e5\u5fd7\u7ba1\u7406\u548c\u5206\u6790\u5de5\u5177\u6765\u5904\u7406\u65e5\u5fd7\u6570\u636e&#xff0c;\u800c\u4e0d\u662f\u624b\u52a8\u7f16\u8f91\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5408\u89c4\u6027\u68c0\u67e5&#xff1a;<\/p>\n<ul>\n<li>\u5728\u7f16\u8f91\u65e5\u5fd7\u4e4b\u524d&#xff0c;\u786e\u4fdd\u64cd\u4f5c\u7b26\u5408\u76f8\u5173\u7684\u6cd5\u5f8b\u548c\u5408\u89c4\u6027\u8981\u6c42\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5b9a\u671f\u8bc4\u4f30&#xff1a;<\/p>\n<ul>\n<li>\u5b9a\u671f\u8bc4\u4f30\u65e5\u5fd7\u7ba1\u7406\u7b56\u7565\u548c\u5b9e\u8df5&#xff0c;\u786e\u4fdd\u5b83\u4eec\u4ecd\u7136\u9002\u7528\u4e8e\u5f53\u524d\u7684\u4e1a\u52a1\u548c\u6280\u672f\u73af\u5883\u3002<\/li>\n<\/ul>\n<\/li>\n<h2 style=\"background-color:transparent\">\u5982\u4f55\u5b9e\u73b0\u540e\u53f0\u65e5\u5fd7\u8f93\u51fa\u5230\u6587\u4ef6<\/h2>\n<h3>1. \u540e\u53f0\u65e5\u5fd7\u8f93\u51fa\u5230\u6587\u4ef6 \u6839\u636e\u6587\u4ef6\u5927\u5c0f(100M)\u81ea\u52a8\u6eda\u52a8\u65b0\u7684\u65e5\u5fd7\u6587\u4ef6<\/h3>\n<li>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528log4j\u6765\u5b9e\u73b0&#xff0c;\u5b83\u63d0\u4f9b\u4e86 RollingFileAppender \u6765\u5b9e\u73b0\u8fd9\u4e00\u529f\u80fd<\/p>\n<\/li>\n<li>\n<p>\u6dfb\u52a0 Log4j2 \u4f9d\u8d56<\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa log4j2.xml \u6587\u4ef6&#xff0c;\u5e76\u6dfb\u52a0\u76f8\u5173\u914d\u7f6e&#xff0c;\u6807\u660e\u81ea\u52a8\u6eda\u52a8\u65b0\u7684\u65e5\u5fd7\u6587\u4ef6\u5927\u5c0f(100M) \u5c06\u65e5\u5fd7\u8f93\u51fa\u5230\u65b0\u7684\u6587\u4ef6\u4e2d, \u5e76\u8868\u660e\u65e5\u5fd7\u6587\u4ef6\u7684\u547d\u540d\u683c\u5f0f<\/p>\n<\/li>\n<p> &lt;RollingFile name&#061;&#034;RollingFile&#034; fileName&#061;&#034;manager.service.$${date:yyyy-MM-dd}.log&#034; filePattern&#061;&#034;manager.service.$${date:yyyy-MM-dd}.log.%i&#034;&gt; <\/p>\n<li>\n<p>\u5728 application.yml \u6587\u4ef6\u4e2d\u6307\u5b9a Log4j2 \u914d\u7f6e\u6587\u4ef6\u7684\u4f4d\u7f6e<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 Logger\u83b7\u53d6\u76f8\u5173\u7684\u65e5\u5fd7\u6587\u4ef6<\/p>\n<\/li>\n<h4>\u76f8\u5173\u95ee\u9898<\/h4>\n<h5>1.1filePattern&#061;&#034;logs\/manager.service.$${date:yyyy-MM-dd}.%i.log.1&#034;\u4e2d%i\u662f\u4ec0\u4e48\u610f\u601d<\/h5>\n<p>\u5728 Log4j2 \u7684\u914d\u7f6e\u4e2d&#xff0c;%i \u662f\u4e00\u4e2a\u7279\u6b8a\u6807\u8bb0&#xff0c;\u7528\u4e8e\u5728\u6eda\u52a8\u65e5\u5fd7\u6587\u4ef6\u65f6\u8868\u793a\u6587\u4ef6\u7684\u7d22\u5f15\u6216\u7248\u672c\u53f7\u3002\u5f53\u65e5\u5fd7\u6587\u4ef6\u8fbe\u5230\u6307\u5b9a\u7684\u5927\u5c0f\u6216\u5176\u4ed6\u6eda\u52a8\u6761\u4ef6\u88ab\u89e6\u53d1\u65f6&#xff0c;Log4j2 \u4f1a\u5c06\u5f53\u524d\u7684\u65e5\u5fd7\u6587\u4ef6\u91cd\u547d\u540d&#xff0c;\u6dfb\u52a0\u8fd9\u4e2a\u7d22\u5f15&#xff0c;\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u65e5\u5fd7\u6587\u4ef6\u7ee7\u7eed\u5199\u5165\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u5982\u679c\u60a8\u7684\u914d\u7f6e\u5982\u4e0b&#xff1a;<\/p>\n<p> &lt;RollingFile name&#061;&#034;RollingFile&#034; fileName&#061;&#034;logs\/manager.service.$${date:yyyy-MM-dd}.log&#034; filePattern&#061;&#034;logs\/manager.service.$${date:yyyy-MM-dd}.%i.log.gz&#034;&gt; &#8230; &lt;\/RollingFile&gt; <\/p>\n<ul>\n<li>\n<p>fileName: logs\/manager.service.$${date:yyyy-MM-dd}.log \u8868\u793a\u65e5\u5fd7\u6587\u4ef6\u7684\u521d\u59cb\u540d\u79f0&#xff0c;\u5176\u4e2d ${date:yyyy-MM-dd} \u4f1a\u88ab\u66ff\u6362\u6210\u5f53\u524d\u7684\u65e5\u671f\u3002<\/p>\n<\/li>\n<li>\n<p>filePattern: logs\/manager.service.$${date:yyyy-MM-dd}.%i.log.gz \u8868\u793a\u6eda\u52a8\u540e\u7684\u65e5\u5fd7\u6587\u4ef6\u7684\u547d\u540d\u6a21\u5f0f\u3002\u8fd9\u91cc\u7684 %i \u4f1a\u88ab\u66ff\u6362\u6210\u4e00\u4e2a\u6570\u5b57&#xff0c;\u6bcf\u6b21\u6587\u4ef6\u6eda\u52a8\u65f6&#xff0c;\u8fd9\u4e2a\u6570\u5b57\u90fd\u4f1a\u589e\u52a0\u3002\u7b2c\u4e00\u4e2a\u6eda\u52a8\u7684\u6587\u4ef6\u901a\u5e38\u662f 1&#xff0c;\u4e0b\u4e00\u4e2a\u662f 2&#xff0c;\u4f9d\u6b64\u7c7b\u63a8\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4f8b\u5982&#xff0c;\u5982\u679c\u5f53\u524d\u65e5\u671f\u662f 2024-10-04&#xff0c;\u5f53\u65e5\u5fd7\u6587\u4ef6 logs\/manager.service.2024-10-04.log \u8fbe\u5230\u6eda\u52a8\u6761\u4ef6\u65f6&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u6b21\u6eda\u52a8&#xff0c;\u5b83\u53ef\u80fd\u4f1a\u88ab\u91cd\u547d\u540d\u4e3a logs\/manager.service.2024-10-04.1.log.gz<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u6b21\u6eda\u52a8&#xff0c;\u5f53\u524d\u7684\u65e5\u5fd7\u6587\u4ef6\u53ef\u80fd\u4f1a\u88ab\u91cd\u547d\u540d\u4e3a logs\/manager.service.2024-10-04.2.log.gz&#xff0c;\u540c\u65f6\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 logs\/manager.service.2024-10-04.log \u6587\u4ef6\u7ee7\u7eed\u5199\u5165\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u6709\u52a9\u4e8e\u60a8\u7ba1\u7406\u548c\u8bc6\u522b\u6eda\u52a8\u65e5\u5fd7\u6587\u4ef6\u7684\u4e0d\u540c\u7248\u672c\u3002\u5982\u679c\u60a8\u5728 DefaultRolloverStrategy \u4e2d\u8bbe\u7f6e\u4e86\u6700\u5927\u6eda\u52a8\u6307\u6570&#xff0c;Log4j2 \u8fd8\u4f1a\u5728\u8fbe\u5230\u6700\u5927\u6570\u91cf\u540e\u5220\u9664\u6700\u65e7\u7684\u6eda\u52a8\u6587\u4ef6\u3002<\/p>\n<h5>1.2 &lt;Pattern&gt;%d %p %c{1.} [%t] %m%n&lt;\/Pattern&gt;\u662f\u4ec0\u4e48\u610f\u601d<\/h5>\n<p>\u5728 Log4j2 \u4e2d&#xff0c;&#096;&lt;PatternLayout&gt;&#096; \u5143\u7d20\u7528\u4e8e\u5b9a\u4e49\u65e5\u5fd7\u6d88\u606f\u7684\u683c\u5f0f\u3002&#096;&lt;Pattern&gt;&#096; \u5143\u7d20\u5185\u7684\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6a21\u5f0f&#xff0c;\u5b83\u6307\u5b9a\u4e86\u65e5\u5fd7\u6d88\u606f\u7684\u5916\u89c2\u3002\u8fd9\u4e2a\u6a21\u5f0f\u4f7f\u7528\u4e00\u7cfb\u5217\u7684\u63a7\u5236\u5b57\u7b26&#xff08;\u5982 &#096;%d&#096;\u3001&#096;%p&#096;\u3001&#096;%c&#096; \u7b49&#xff09;\u6765\u5305\u542b\u7279\u5b9a\u7684\u65e5\u5fd7\u4e8b\u4ef6\u4fe1\u606f\u3002\u4ee5\u4e0b\u662f\u60a8\u63d0\u4f9b\u7684\u6a21\u5f0f\u7684\u7ec4\u6210\u90e8\u5206&#xff1a;<\/p>\n<p>&#8211; &#096;%d&#096;&#xff1a;\u65e5\u671f\u3002\u9ed8\u8ba4\u683c\u5f0f\u662f ISO8601&#xff0c;\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u683c\u5f0f&#xff0c;\u5982 &#096;%d{yyyy-MM-dd HH:mm:ss}&#096;\u3002<\/p>\n<p>&#8211; &#096;%p&#096;&#xff1a;\u65e5\u5fd7\u7ea7\u522b&#xff08;\u5982 INFO\u3001WARN\u3001ERROR \u7b49&#xff09;\u3002<\/p>\n<p>&#8211; &#096;%c&#096;&#xff1a;\u65e5\u5fd7\u8bb0\u5f55\u5668\u7684\u540d\u79f0\u3002&#096;%c{1}&#096; \u8868\u793a\u8bb0\u5f55\u5668\u540d\u79f0\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20&#xff08;\u901a\u5e38\u662f\u7c7b\u540d&#xff09;&#xff0c;\u5982\u679c\u82b1\u62ec\u53f7\u5185\u7684\u6570\u5b57\u66f4\u5927&#xff0c;\u5b83\u5c06\u5305\u542b\u66f4\u5b8c\u6574\u7684\u8bb0\u5f55\u5668\u540d\u79f0\u3002<\/p>\n<p>&#8211; &#096;%t&#096;&#xff1a;\u8868\u793a\u7ebf\u7a0b\u540d\u79f0\u3002<\/p>\n<p>&#8211; &#096;%m&#096;&#xff1a;\u65e5\u5fd7\u6d88\u606f\u3002<\/p>\n<p>&#8211; &#096;%n&#096;&#xff1a;\u4ee3\u8868\u5e73\u53f0\u7684\u884c\u5206\u9694\u7b26\u3002\u5728 UNIX \u7cfb\u7edf\u4e2d\u662f &#096;\\\\n&#096;&#xff0c;\u5728 Windows \u7cfb\u7edf\u4e2d\u662f &#096;\\\\r\\\\n&#096;\u3002<\/p>\n<p>\u6240\u4ee5&#xff0c;&#096;&lt;Pattern&gt;%d %p %c{1.} [%t] %m%n&lt;\/Pattern&gt;&#096; \u7684\u542b\u4e49\u662f&#xff1a;<\/p>\n<p>&#8211; \u65e5\u5fd7\u6d88\u606f\u5c06\u4ee5\u4e00\u5b9a\u7684\u65e5\u671f\u683c\u5f0f\u5f00\u59cb&#xff08;\u9ed8\u8ba4\u683c\u5f0f&#xff09;\u3002<\/p>\n<p>&#8211; \u7d27\u63a5\u7740\u662f\u65e5\u5fd7\u7ea7\u522b\u3002<\/p>\n<p>&#8211; \u7136\u540e\u662f\u65e5\u5fd7\u8bb0\u5f55\u5668\u7684\u540d\u79f0&#xff08;\u7c7b\u540d&#xff09;\u3002<\/p>\n<p>&#8211; \u4e2d\u62ec\u53f7\u5185\u662f\u7ebf\u7a0b\u540d\u79f0\u3002<\/p>\n<p>&#8211; \u4e4b\u540e\u662f\u65e5\u5fd7\u6d88\u606f\u672c\u8eab\u3002<\/p>\n<p>&#8211; \u6700\u540e\u662f\u4e00\u4e2a\u6362\u884c\u7b26\u3002<\/p>\n<p>\u8fd9\u4e2a\u6a21\u5f0f\u7684\u7ed3\u679c\u53ef\u80fd\u662f\u8fd9\u6837\u7684\u4e00\u6761\u65e5\u5fd7\u6d88\u606f&#xff1a;<\/p>\n<p>2024-10-04 10:20:30 INFO com.example.MyClass [main] This is a log message.<\/p>\n<p>\u8fd9\u6761\u6d88\u606f\u8868\u793a\u5728 2024 \u5e74 10 \u6708 4 \u65e5 10:20:30&#xff0c;&#096;com.example.MyClass&#096; \u7c7b&#xff08;\u7531 &#096;main&#096; \u7ebf\u7a0b&#xff09;\u8bb0\u5f55\u4e86\u4e00\u6761 INFO \u7ea7\u522b\u7684\u65e5\u5fd7\u6d88\u606f &#034;This is a log message.&#034;\u3002<\/p>\n<h5>1.3Logback \u548c Log4j2 \u662f\u4e24\u4e2a\u4e0d\u540c\u7684\u65e5\u5fd7\u6846\u67b6&#xff0c;\u5b83\u4eec\u7684\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f\u4e0d\u517c\u5bb9\u3002<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"662\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419005623-6802f4b760cd8.png\" width=\"1198\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"658\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419005623-6802f4b7c2271.png\" width=\"1197\" \/><\/p>\n<p>\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u8bf7\u786e\u4fdd\u60a8\u4f7f\u7528\u7684\u662f Logback \u7684\u914d\u7f6e\u6587\u4ef6&#xff0c;\u5e76\u4e14\u914d\u7f6e\u6807\u7b7e\u6b63\u786e\u3002\u5982\u679c\u60a8\u6b63\u5728\u4f7f\u7528 Spring Boot&#xff0c;\u9ed8\u8ba4\u7684\u65e5\u5fd7\u6846\u67b6\u662f Logback&#xff0c;\u6240\u4ee5\u60a8\u9700\u8981\u4f7f\u7528 Logback \u7684\u914d\u7f6e\u65b9\u5f0f\u3002<\/p>\n<p>\u5c06xml\u6587\u4ef6\u7531 \u4e3a Logback \u65e5\u5fd7\u6846\u67b6\u8f6c\u53d8\u4e3a Log4j\u7684\u6846\u67b6<\/p>\n<h3>2. \u901a\u8fc7linux\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u811a\u672c&#xff0c;\u5bf9\u6587\u4ef6\u8fdb\u884c\u5b9a\u65f6\u538b\u7f29\u3001\u5220\u9664<\/h3>\n<h4>\u538b\u7f29<\/h4>\n<li>\n<p>\u5148\u5bf9\u539f\u6587\u4ef6\u8fdb\u884c\u590d\u5236 cp service.log.2024-10-4.log service.log.2024-10-4.log.1<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u590d\u5236\u6587\u4ef6\u8fdb\u884c\u538b\u7f29 tar -zcvf test.gz service.log.2024-10-4.log.1<\/p>\n<\/li>\n<li>\n<p>\u5220\u9664\u590d\u5236\u6587\u4ef6 rm -rf service.log.2024-10-4.log.1<\/p>\n<\/li>\n<p>\u505a\u6cd5&#xff1a;<\/p>\n<p>\u5728Linux\u7cfb\u7edf\u4e2d&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528crontab\u6765\u5b89\u6392\u5b9a\u65f6\u4efb\u52a1\u3002\u8981\u5b9e\u73b0\u4f60\u7684\u9700\u6c42&#xff0c;\u4f60\u9700\u8981\u7f16\u8f91\u5f53\u524d\u7528\u6237\u7684crontab\u6587\u4ef6&#xff0c;\u5e76\u6dfb\u52a0\u4e00\u884c\u6765\u6307\u5b9a\u6bcf\u59290\u70b9\u6267\u884c\u4f60\u7684\u811a\u672c\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u4f60\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u811a\u672c\u6587\u4ef6&#xff0c;\u6bd4\u5982\u547d\u540d\u4e3alog_backup.sh&#xff0c;\u5e76\u5c06\u4f60\u63d0\u5230\u7684\u547d\u4ee4\u5199\u5165\u8fd9\u4e2a\u811a\u672c&#xff1a;<\/p>\n<p>vim log_backup.sh #\u521b\u5efa\u811a\u672c\u6587\u4ef6<br \/>\n# \u83b7\u53d6\u5f53\u524d\u65e5\u671f<br \/>\ncurrent_date&#061;$(date &#043;%Y-%m-%d)<br \/>\n# \u590d\u5236\u6587\u4ef6<br \/>\n cp service.log.$current_data.log service.log.$current_date.log.1<br \/>\n# \u5bf9\u590d\u5236\u6587\u4ef6\u8fdb\u884c\u538b\u7f29<br \/>\n tar -zcvf service.log.$(date &#043;%Y-%m-%d).log.tar.gz service.log.$(date &#043;%Y-%m-%d).log<br \/>\n# \u5220\u9664\u590d\u5236\u6587\u4ef6<br \/>\nrm -f service.log.$current_date.log.1 <\/p>\n<p>\u7136\u540e&#xff0c;\u4f60\u9700\u8981\u7ed9\u8fd9\u4e2a\u811a\u672c\u6587\u4ef6\u6267\u884c\u6743\u9650&#xff1a;<\/p>\n<p>chmod &#043;x log_backup.sh <\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;\u6253\u5f00crontab\u6587\u4ef6\u8fdb\u884c\u7f16\u8f91&#xff1a;<\/p>\n<p>crontab -e <\/p>\n<p>\u5728\u6253\u5f00\u7684\u7f16\u8f91\u5668\u4e2d&#xff0c;\u6dfb\u52a0\u4ee5\u4e0b\u884c&#xff1a;<\/p>\n<p>0 0 * * * \/www\/wwwlogs\/log_backup.sh <\/p>\n<p>\u8fd9\u884c\u7684\u610f\u601d\u662f&#xff1a;<\/p>\n<ul>\n<li>\n<p>0 0 \u8868\u793a\u5728\u6bcf\u5929\u76840\u70b90\u5206<\/p>\n<\/li>\n<li>\n<p>* * * \u8868\u793a\u6bcf\u4e2a\u6708\u7684\u6bcf\u5929<\/p>\n<\/li>\n<li>\n<p>\u6700\u540e\u662f\u6267\u884c\u7684\u811a\u672c\u8def\u5f84<\/p>\n<\/li>\n<\/ul>\n<p>\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668&#xff0c;crontab\u5c31\u4f1a\u81ea\u52a8\u52a0\u8f7d\u8fd9\u4e2a\u65b0\u7684\u4efb\u52a1\u3002<\/p>\n<p>\u786e\u4fdd\u4f60\u7684\u811a\u672c\u6587\u4ef6\u8def\u5f84\u662f\u6b63\u786e\u7684&#xff0c;\u5e76\u4e14\u811a\u672c\u6709\u6267\u884c\u6743\u9650\u3002\u8fd9\u6837&#xff0c;\u6bcf\u59290\u70b9&#xff0c;crontab\u5c31\u4f1a\u81ea\u52a8\u6267\u884c\u4f60\u7684\u811a\u672c&#xff0c;\u5b8c\u6210\u4f60\u63cf\u8ff0\u7684\u64cd\u4f5c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"67\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419005624-6802f4b82fbf6.png\" width=\"400\" \/><\/p>\n<h4>\u5220\u9664<\/h4>\n<p>1. \u7f16\u5199\u5220\u9664\u8fc7\u671f\u6587\u4ef6\u7684\u811a\u672c<\/p>\n<p>\u9996\u5148&#xff0c;\u521b\u5efa\u4e00\u4e2a\u811a\u672c&#xff0c;\u8be5\u811a\u672c\u5c06\u5220\u9664\u5f53\u524d\u76ee\u5f55\u4e0b7\u5929\u524d\u7684\u6587\u4ef6\u3002\u4f7f\u7528find\u547d\u4ee4\u975e\u5e38\u9002\u5408\u8fd9\u9879\u4efb\u52a1\u3002<\/p>\n<p>#\u521b\u5efa\u4e00\u4e2a\u811a\u672c<br \/>\nvim delete_old_logs.sh<br \/>\n# \u5b9a\u4e49\u65e5\u5fd7\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55<br \/>\nLOG_DIR&#061;&#034;\/www\/wwwlogs&#034;<br \/>\n# \u5220\u96647\u5929\u524d\u7684\u65e5\u5fd7\u6587\u4ef6<br \/>\nfind &#034;$LOG_DIR&#034; -name &#034;*.log&#034; -type f -mtime &#043;7 -exec rm -f {} \\\\;<br \/>\n# \u6253\u5370\u51fa\u88ab\u5220\u9664\u7684\u6587\u4ef6&#xff0c;\u65b9\u4fbf\u8c03\u8bd5<br \/>\necho &#034;Deleted files:&#034; find &#034;$LOG_DIR&#034; -name &#034;*.log&#034; -type f -mtime &#043;7 -exec echo {} \\\\; <\/p>\n<p>\u4fdd\u5b58\u8fd9\u4e2a\u811a\u672c\u4e3a delete_old_logs.sh&#xff0c;\u5e76\u7ed9\u4e88\u6267\u884c\u6743\u9650&#xff1a;<\/p>\n<p>chmod &#043;x delete_old_logs.sh <\/p>\n<p>1.\u8bbe\u7f6eCron Job<\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;\u8bbe\u7f6e\u4e00\u4e2acron job\u6765\u5b9a\u671f\u6267\u884c\u8fd9\u4e2a\u811a\u672c\u3002<\/p>\n<p>2.\u7f16\u8f91\u5f53\u524d\u7528\u6237\u7684crontab\u6587\u4ef6&#xff1a;<\/p>\n<p> crontab -e <\/p>\n<p>3.\u6dfb\u52a0\u4e00\u884c\u6765\u5b89\u6392\u4efb\u52a1<\/p>\n<p>\u5047\u8bbe\u4f60\u5e0c\u671b\u6bcf\u5929\u51cc\u66680\u70b9\u6267\u884c\u8fd9\u4e2a\u811a\u672c&#xff0c;\u53ef\u4ee5\u6dfb\u52a0\u5982\u4e0b\u884c&#xff1a;<\/p>\n<p> 0 0 * * * \/www\/wwwlogs\/delete_old_logs.sh <\/p>\n<p>4.\u786e\u8ba4Cron Job\u5df2\u6dfb\u52a0<\/p>\n<p>\u67e5\u770b\u5f53\u524d\u7684cron jobs&#xff1a;<\/p>\n<p> crontab -l <\/p>\n<p>\u786e\u4fdd\u4f60\u7684\u65b0\u4efb\u52a1\u5df2\u7ecf\u5217\u5728\u5176\u4e2d\u3002<\/p>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4&#xff0c;\u4f60\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2acron job\u6765\u81ea\u52a8\u5220\u96647\u5929\u524d\u7684\u65e5\u5fd7\u6587\u4ef6\u3002<\/p>\n<p>\u5df2\u7ecf\u6ca1\u6709\u4e86\u4e03\u5929\u524d\u7684.log\u7ed3\u5c3e\u7684\u65e5\u5fd7\u6587\u4ef6<\/p>\n<h2>\u6839\u636e\u6587\u4ef6\u5927\u5c0f\u81ea\u52a8\u6eda\u52a8\u65b0\u7684\u65e5\u5fd7\u6587\u4ef6<\/h2>\n<p>\u4f8b\u5982&#xff1a;10KB\u5c31\u8fdb\u884c\u538b\u7f29log.1.gz<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"281\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419005624-6802f4b84a84b.png\" width=\"1200\" \/><\/p>\n<h3>\u6d41\u7a0b<\/h3>\n<h4>1. \u521b\u5efa\u811a\u672c\u6587\u4ef6<\/h4>\n<p>\u9996\u5148&#xff0c;\u521b\u5efa\u4e00\u4e2a\u811a\u672c\u6587\u4ef6&#xff0c;\u6bd4\u5982\u547d\u540d\u4e3a compress_log.sh\u3002<\/p>\n<p>nano \/www\/wwwlogs\/compress_log.sh <\/p>\n<h4>2. \u7f16\u5199\u811a\u672c\u5185\u5bb9<\/h4>\n<p>\u5728\u811a\u672c\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p>#!\/bin\/bash<br \/>\n# \u5b9a\u4e49\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84<br \/>\nLOG_FILE&#061;&#034;\/www\/wwwlogs\/bak.guaibill.com.log&#034;<br \/>\n# \u5b9a\u4e49\u6587\u4ef6\u5927\u5c0f\u9608\u503c&#xff08;10KB&#xff09;<br \/>\nMAX_SIZE&#061;$((10 * 1024))<br \/>\n# \u83b7\u53d6\u5f53\u524d\u65e5\u671f<br \/>\nCURRENT_DATE&#061;$(date &#043;%Y-%m-%d)<br \/>\n# \u521d\u59cb\u5316\u6587\u4ef6\u7248\u672c\u53f7<br \/>\nVERSION&#061;1<br \/>\n# \u68c0\u67e5\u65e5\u5fd7\u6587\u4ef6\u662f\u5426\u5b58\u5728<br \/>\nif [ ! -f &#034;$LOG_FILE&#034; ];<br \/>\nthen echo &#034;Log file does not exist: $LOG_FILE&#034; exit 1 fi<br \/>\n# \u68c0\u67e5\u65e5\u5fd7\u6587\u4ef6\u5927\u5c0f<br \/>\nFILE_SIZE&#061;$(stat -c%s &#034;$LOG_FILE&#034;)<br \/>\nwhile [ &#034;$FILE_SIZE&#034; -ge &#034;$MAX_SIZE&#034; ]; do<br \/>\n# \u6784\u5efa\u538b\u7f29\u6587\u4ef6\u540d COMPRESSED_FILE&#061;&#034;\/www\/wwwlogs\/bak.guaibill.com.log.${CURRENT_DATE}.${VERSION}.gz&#034;<br \/>\n# \u627e\u5230\u672a\u4f7f\u7528\u7684\u538b\u7f29\u6587\u4ef6\u540d<br \/>\nwhile [ -f &#034;$COMPRESSED_FILE&#034; ];<br \/>\ndo VERSION&#061;$((VERSION &#043; 1)) COMPRESSED_FILE&#061;&#034;\/www\/wwwlogs\/bak.guaibill.com.log.${CURRENT_DATE}.${VERSION}.gz&#034; done<br \/>\n# \u538b\u7f29\u6587\u4ef6<br \/>\ngzip -c &#034;$LOG_FILE&#034; &gt; &#034;$COMPRESSED_FILE&#034;<br \/>\n# \u68c0\u67e5\u538b\u7f29\u662f\u5426\u6210\u529f<br \/>\nif [ $? -eq 0 ]; then echo &#034;File compressed successfully: $COMPRESSED_FILE&#034;<br \/>\n# Truncate the original log file<br \/>\n&gt; &#034;$LOG_FILE&#034; VERSION&#061;1 else echo &#034;Failed to compress file.&#034; exit 1 fi<br \/>\n# \u91cd\u65b0\u68c0\u67e5\u65e5\u5fd7\u6587\u4ef6\u5927\u5c0f<br \/>\nFILE_SIZE&#061;$(stat -c%s &#034;$LOG_FILE&#034;) done <\/p>\n<h4>3. \u8d4b\u4e88\u811a\u672c\u6267\u884c\u6743\u9650<\/h4>\n<p>chmod &#043;x \/www\/wwwlogs\/compress_log.sh <\/p>\n<h4>4. \u8bbe\u7f6eCron Job<\/h4>\n<\/p>\n<p>\u8981\u5b9a\u671f\u6267\u884c\u8fd9\u4e2a\u811a\u672c&#xff0c;\u4f60\u53ef\u4ee5\u5c06\u5176\u8bbe\u7f6e\u4e3a cron \u5b9a\u65f6\u4efb\u52a1\u3002\u7531\u4e8e\u4f60\u9700\u8981\u811a\u672c\u5728\u6587\u4ef6\u8fbe\u523010KB\u65f6\u7acb\u5373\u6267\u884c&#xff0c;\u4f60\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u9ad8\u9891\u7684 cron \u4efb\u52a1&#xff0c;\u6bd4\u5982\u6bcf\u5206\u949f\u6267\u884c\u4e00\u6b21&#xff1a;<\/p>\n<\/p>\n<p>1. \u7f16\u8f91\u5f53\u524d\u7528\u6237\u7684crontab\u6587\u4ef6&#xff1a;<\/p>\n<p>crontab -e <\/p>\n<p>2. \u6dfb\u52a0\u4e00\u884c\u6765\u5b89\u6392\u4efb\u52a1&#xff1a;<\/p>\n<p>* * * * * \/www\/wwwlogs\/compress_log.sh <\/p>\n<p>3. \u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668&#xff1a;<\/p>\n<p>\u6309 Esc&#xff0c;\u8f93\u5165 :wq&#xff0c;\u7136\u540e\u6309 Enter\u3002<\/p>\n<h4>5. \u9a8c\u8bc1Cron Job<\/h4>\n<p>\u67e5\u770b\u5f53\u524d\u7684cron jobs&#xff1a;<\/p>\n<p>crontab -l <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.9k\u6b21\uff0c\u70b9\u8d5e45\u6b21\uff0c\u6536\u85cf52\u6b21\u3002\u65e5\u5fd7\u8f93\u51fa\u5230\u6587\u4ef6\u4e2d, \u65e5\u5fd7\u6587\u4ef6\u547d\u540d\u683c\u5f0f\uff1a\u4e24\u79cd\u6eda\u52a8\u65b9\u5f0f\u542f\u52a8\u53c2\u6570\uff1a-Dlogs=\/www\/wwwlogs\/admin\/IDEA\u4e2d\u914d\u7f6e\u542f\u52a8\u53c2\u6570java -jar \u5e26\u542f\u52a8\u53c2\u6570\u3002_\u670d\u52a1\u5668\u540e\u53f0\u65e5\u5fd7<\/p>\n","protected":false},"author":2,"featured_media":23920,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[458,1835],"topic":[],"class_list":["post-23924","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-vue","tag-1835"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/23924.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.9k\u6b21\uff0c\u70b9\u8d5e45\u6b21\uff0c\u6536\u85cf52\u6b21\u3002\u65e5\u5fd7\u8f93\u51fa\u5230\u6587\u4ef6\u4e2d, \u65e5\u5fd7\u6587\u4ef6\u547d\u540d\u683c\u5f0f\uff1a\u4e24\u79cd\u6eda\u52a8\u65b9\u5f0f\u542f\u52a8\u53c2\u6570\uff1a-Dlogs=\/www\/wwwlogs\/admin\/IDEA\u4e2d\u914d\u7f6e\u542f\u52a8\u53c2\u6570java -jar \u5e26\u542f\u52a8\u53c2\u6570\u3002_\u670d\u52a1\u5668\u540e\u53f0\u65e5\u5fd7\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/23924.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-19T00:56:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419005623-6802f4b760cd8.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/23924.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/23924.html\",\"name\":\"\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-19T00:56:25+00:00\",\"dateModified\":\"2025-04-19T00:56:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/23924.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/23924.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/23924.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/23924.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.9k\u6b21\uff0c\u70b9\u8d5e45\u6b21\uff0c\u6536\u85cf52\u6b21\u3002\u65e5\u5fd7\u8f93\u51fa\u5230\u6587\u4ef6\u4e2d, \u65e5\u5fd7\u6587\u4ef6\u547d\u540d\u683c\u5f0f\uff1a\u4e24\u79cd\u6eda\u52a8\u65b9\u5f0f\u542f\u52a8\u53c2\u6570\uff1a-Dlogs=\/www\/wwwlogs\/admin\/IDEA\u4e2d\u914d\u7f6e\u542f\u52a8\u53c2\u6570java -jar \u5e26\u542f\u52a8\u53c2\u6570\u3002_\u670d\u52a1\u5668\u540e\u53f0\u65e5\u5fd7","og_url":"https:\/\/www.wsisp.com\/helps\/23924.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-19T00:56:25+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419005623-6802f4b760cd8.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/23924.html","url":"https:\/\/www.wsisp.com\/helps\/23924.html","name":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-19T00:56:25+00:00","dateModified":"2025-04-19T00:56:25+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/23924.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/23924.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/23924.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u5bf9\u540e\u53f0\u65e5\u5fd7\u8fdb\u884c\u7f16\u8f91"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/23924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=23924"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/23924\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/23920"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=23924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=23924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=23924"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=23924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}