mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
999 B
999 B
在Arthas里有一些开关,可以通过 options{{execute T2}} 命令来查看。
查看单个option的值,比如
options unsafe{{execute T2}}
允许增强JDK的类
默认情况下unsafe为false,即watch/trace等命令不会增强JVM的类,即java.*下面的类。
如果想增强JVM里的类,可以执行 options unsafe true{{execute T2}} ,设置unsafe为true。
以JSON格式打印对象
当 json-format 为false时,输出结果是:
$ ognl '#value1=@System@getProperty("java.home"), #value2=@System@getProperty("java.runtime.name"), {#value1, #value2}'
@ArrayList[
@String[/usr/lib/jvm/java-8-oracle/jre],
@String[Java(TM) SE Runtime Environment],
]
options json-format true{{execute T2}}
当 json-format 为true时,输出结果是:
$ ognl '#value1=@System@getProperty("java.home"), #value2=@System@getProperty("java.runtime.name"), {#v["/usr/lib/jvm/java-8-oracle/jre","Java(TM) SE Runtime Environment"]