首页  

arthas 使用 ognl 设置日志级别     所属分类 arthas 浏览量 1387
ognl '@com.dyyx.util.ApplicationContextUtil@context'
Failed to execute ognl, exception message: ognl.OgnlException: Could not get static field context from class com.dyyx.util.ApplicationContextUtil 
[java.lang.ClassNotFoundException: Unable to resolve class: com.dyyx.util.ApplicationContextUtil], 
please check $HOME/logs/arthas/arthas.log for more details. 
[arthas@8875]$ sc -d com.dyyx.util.ApplicationContextUtil

ognl -c 179d3b25  '@com.dyyx.util.ApplicationContextUtil@context' 

getstatic com.dyyx.util.ApplicationContextUtil  context

getstatic 不需要 -c 参数

调用实例方法

获取 spring 激活的 profile
getstatic cn.tongdun.kratos.api.core.util.ApplicationContextUtil  context 'getEnvironment().getActiveProfiles()'

// 可更新数据
getstatic xxx.CacheInfo dataMap 'put("key","value")'



ognl -c 179d3b25 '@com.dyyx.util.ApplicationContextUtil@context.getEnvironment().getActiveProfiles()'
@String[][
    @String[test],
]

查看 log

logger

获取 log 

ognl -c 179d3b25  '@com.dyyx.web.HelloController@log' 

getstatic com.dyyx.web.HelloController log

ognl -c 179d3b25  '@org.slf4j.LoggerFactory@getLogger("root")'

设置日志级别

ognl -c 179d3b25  '@org.slf4j.LoggerFactory@getLogger("root").setLevel(@ch.qos.logback.classic.Level@DEBUG)'

上一篇     下一篇
synchronized知识点

TCP 重传 滑动窗口 流量控制 拥塞控制

tomcat 热加载 热部署

ThreadLocal 与 SimpleDateFormat

hashCode和identifyHashCode区别

clickhouse表引擎