You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/assets/save-log.html.4729e1df.js

10 lines
3.6 KiB
JavaScript

import{_ as i,o as c,c as d,a as e,b as o,w as t,e as s,d as r,r as a}from"./app.7f0a416a.js";const u={},h=e("h1",{id:"log-command-outputs",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#log-command-outputs","aria-hidden":"true"},"#"),s(" Log command outputs")],-1),p={href:"https://arthas.aliyun.com/doc/arthas-tutorials?language=en&id=case-save-log",target:"_blank",rel:"noopener noreferrer"},m=e("code",null,"Log command outputs",-1),_=s(" online tutorial"),b=r(`<div class="custom-container tip"><p class="custom-container-title">TIP</p><p>Log command outputs for later analysis</p></div><ul><li><p>By default, this behavior is turned off. To enable it, execute the command below:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ options save-result <span class="token boolean">true</span>
NAME BEFORE-VALUE AFTER-VALUE
----------------------------------------
save-result <span class="token boolean">false</span> <span class="token boolean">true</span>
Affect<span class="token punctuation">(</span>row-cnt:1<span class="token punctuation">)</span> cost <span class="token keyword">in</span> <span class="token number">3</span> ms.
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If the message above is output on the console, then this behavior is enabled successfully.</p></li><li><p>Log file path</p><p>The command execution result will be save in <code>{user.home}/logs/arthas-cache/result.log</code>. Pls. clean it up regularly to save disk space.</p></li></ul><h3 id="use-asynchronous-job-to-log" tabindex="-1"><a class="header-anchor" href="#use-asynchronous-job-to-log" aria-hidden="true">#</a> Use asynchronous job to log</h3><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ trace Test t <span class="token operator">&gt;&gt;</span> <span class="token operator">&amp;</span>
job <span class="token function">id</span> <span class="token builtin class-name">:</span> <span class="token number">2</span>
cache location <span class="token builtin class-name">:</span> /Users/zhuyong/logs/arthas-cache/28198/2
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>By doing this, the command will run at background asynchronously, and output the execution result into <code>~/logs/arthas-cache/{PID}/{JobId}</code>:</p>`,5),v=s("The background job will continue to run even if the current session is disconnected. The default job timeout value is 1 day, use global '"),g=s("options"),f=s("' command to alternate it."),k=s("The execution result will be output into the file asynchronously. Pls. note the behavior of this command is not controlled by "),y=e("code",null,"save-result",-1),x=s(" option from global "),w=s("options"),L=s(". No matter "),E=e("code",null,"save-result",-1),T=s(" is set to "),I=e("code",null,"true",-1),j=s(" or not, this command will write into "),B=e("code",null,"~/logs/arthas-cache/{PID}/{JobId}",-1),N=s(" anyway, instead of into "),V=e("code",null,"~/logs/arthas-cache/result.log",-1),A=s(".");function P(R,U){const l=a("ExternalLinkIcon"),n=a("RouterLink");return c(),d("div",null,[h,e("p",null,[e("a",p,[m,_,o(l)])]),b,e("ul",null,[e("li",null,[v,o(n,{to:"/en/doc/options.html"},{default:t(()=>[g]),_:1}),f]),e("li",null,[k,y,x,o(n,{to:"/en/doc/options.html"},{default:t(()=>[w]),_:1}),L,E,T,I,j,B,N,V,A])])])}var D=i(u,[["render",P],["__file","save-log.html.vue"]]);export{D as default};