options

options在线教程

全局开关

名称默认值描述
unsafefalse是否支持对系统级别的类进行增强,打开该开关可能导致把JVM搞挂,请慎重选择!
dumpfalse是否支持被增强了的类dump到外部文件中,如果打开开关,class文件会被dump到/${application working dir}/arthas-class-dump/目录下,具体位置详见控制台输出
batch-re-transformtrue是否支持批量对匹配到的类执行retransform操作
json-formatfalse是否支持json化的输出
disable-sub-classfalse是否禁用子类匹配,默认在匹配目标类的时候会默认匹配到其子类,如果想精确匹配,可以关闭此开关
support-default-methodtrue是否支持匹配到default method,默认会查找interface,匹配里面的default method。参考 #1105
save-resultfalse是否打开执行结果存日志功能,打开之后所有命令的运行结果都将保存到~/logs/arthas-cache/result.log
job-timeout1d异步后台任务的默认超时时间,超过这个时间,任务自动停止;比如设置 1d, 2h, 3m, 25s,分别代表天、小时、分、秒
print-parent-fieldstrue是否打印在parent class里的filed

查看所有的options

  1. $ options
  2. LEVEL TYPE NAME VALUE SUMMARY DESCRIPTION
  3. --------------------------------------------------------------------------------------------
  4. 0 bool unsafe false Option to support This option enables to proxy function
  5. ean system-level class ality of JVM classes. Due to serious
  6. security risk a JVM crash is possibly
  7. be introduced. Do not activate it un
  8. less you are able to manage.
  9. 1 bool dump false Option to dump the This option enables the enhanced clas
  10. ean enhanced classes ses to be dumped to external file for
  11. further de-compilation and analysis.
  12. 1 bool batch-re-tr true Option to support This options enables to reTransform c
  13. ean ansform batch reTransform lasses with batch mode.
  14. Class
  15. 2 bool json-format false Option to support This option enables to format object
  16. ean JSON format of obj output with JSON when -x option selec
  17. ect output ted.
  18. 1 bool disable-sub false Option to control This option disable to include sub cl
  19. ean -class include sub class ass when matching class.
  20. when class matchin
  21. g
  22. 1 bool save-result false Option to print co This option enables to save each comm
  23. ean mmand's result to and's result to log file, which path
  24. log file is ${user.home}/logs/arthas-cache/res
  25. ult.log.
  26. 2 Stri job-timeout 1d Option to job time This option setting job timeout,The u
  27. ng out nit can be d, h, m, s for day, hour,
  28. minute, second. 1d is one day in defa
  29. ult
  30. 1 bool print-paren true Option to print al This option enables print files in pa
  31. ean t-fields l fileds in parent rent class, default value true.
  32. class

获取option的值

  1. $ options json-format
  2. LEVEL TYPE NAME VALUE SUMMARY DESCRIPTION
  3. --------------------------------------------------------------------------------------------
  4. 2 bool json-format false Option to support This option enables to format object
  5. ean JSON format of obj output with JSON when -x option selec
  6. ect output ted.

默认情况下json-format为false,如果希望watch/tt等命令结果以json格式输出,则可以设置json-format为true。

设置指定的option

例如,想打开执行结果存日志功能,输入如下命令即可:

  1. $ options save-result true
  2. NAME BEFORE-VALUE AFTER-VALUE
  3. ----------------------------------------
  4. save-result false true