@zhangever
2018-03-21T09:51:47.000000Z
字数 6811
阅读 761
jmx
```
jmx-cli > ps
Connecting to localhost ...
500 cli.jar
14 com.github.dapeng.bootstrap.Bootstrap
jmx-cli > connect pid:14
Connected to server (rmi://172.19.0.6 2).
29 MBean(s) registered with server.
jmx-cli > list
MBean list [all]
java.lang:name=Metaspace,type=MemoryPool
java.lang:name=PS Old Gen,type=MemoryPool
org.apache.commons.pool2:name=pool,type=GenericObjectPool
java.lang:type=Runtime
java.lang:name=PS Scavenge,type=GarbageCollector
java.lang:type=Threading
java.lang:name=PS Eden Space,type=MemoryPool
java.nio:name=mapped,type=BufferPool
java.lang:name=Compressed Class Space,type=MemoryPool
com.alibaba.druid:type=DruidDataSourceStat
java.lang:name=PS Survivor Space,type=MemoryPool
java.util.logging:type=Logging
java.lang:type=Compilation
java.lang:type=OperatingSystem
java.lang:name=Metaspace Manager,type=MemoryManager
JMImplementation:type=MBeanServerDelegate
java.lang:type=ClassLoading
com.sun.management:type=HotSpotDiagnostic
java.lang:name=CodeCacheManager,type=MemoryManager
java.lang:name=Code Cache,type=MemoryPool
ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator
com.alibaba.druid:type=MockDriver
com.alibaba.druid:type=DruidDriver
java.nio:name=direct,type=BufferPool
com.alibaba.druid:id=988402146,type=DruidDataSource
com.alibaba.druid:type=DruidStatService
java.lang:name=PS MarkSweep,type=GarbageCollector
com.sun.management:type=DiagnosticCommand
java.lang:type=Memory
29 objects found.
jmx-cli > list filter:"ch.qos.logback.classic:*" label:true
MBean list [ch.qos.logback.classic:*]
[$0] ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator
1 objects found.
jmx-cli > desc
desc attribs:* desc attribs:<attribName>
desc attribs:[attribList] desc bean:<MBeanLabel>
desc bean:<NamePattern>
desc ops:*
desc ops:<operationName>
desc ops:[operationList]
jmx-cli > desc bean:$0
MBean: ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator (ch.qos.logback.classic.jmx.JMXConfigurator)
Information on the management interface of the MBean
Attributes:
LoggerList : java.util.List (r) - Attribute exposed for management
Statuses : java.util.List (r) - Attribute exposed for management
Operations:
getLoggerLevel(java.lang.String):java.lang.String
setLoggerLevel(java.lang.String,java.lang.String):void
reloadDefaultConfiguration():void
getLoggerEffectiveLevel(java.lang.String):java.lang.String
reloadByURL(java.net.URL):void
reloadByFileName(java.lang.String):void
jmx-cli > exec
exec bean:<MBeanLabel>
exec bean:<NamePattern>
exec get:<AttributeName>
exec op:<OperationName>
exec params:<ParamValue>
exec params:[ParamList]
exec set:<AttributeName>
jmx-cli > exec bean:$0 get:LoggerList
LoggerList ==> [[ROOT, com, com.github, com.github.dapeng, com.github.dapeng.client, com.github.dapeng.client.netty, com.github.dapeng.client.netty.IdleConnectionManager, com.github.dapeng.client.netty.NettyClient, com.github.dapeng.client.netty.SoaBaseConnection, com.github.dapeng.client.netty.SoaClientHandler, com.github.dapeng.client.netty.SoaConnectionImpl, com.github.dapeng.client.netty.SoaConnectionPoolImpl, com.github.dapeng.client.netty.SoaIdleHandler, com.github.dapeng.impl, com.github.dapeng.impl.container, com.github.dapeng.impl.container.DapengApplication, com.github.dapeng.impl.container.DapengContainer, com.github.dapeng.impl.filters, com.github.dapeng.impl.filters.FlowControlFilter, com.github.dapeng.impl.filters.HeadFilter, com.github.dapeng.impl.plugins, com.github.dapeng.impl.plugins.LogbackPlugin, com.github.dapeng.impl.plugins.SpringAppLoader, com.github.dapeng.impl.plugins.TaskSchedulePlugin, com.github.dapeng.impl.plugins.ZookeeperRegistryPlugin, com.github.dapeng.impl.plugins.netty, com.github.dapeng.impl.plugins.netty.NettyPlugin, com.github.dapeng.impl.plugins.netty.SoaFlowCounter, com.github.dapeng.impl.plugins.netty.SoaFrameDecoder, com.github.dapeng.impl.plugins.netty.SoaIdleHandler, com.github.dapeng.impl.plugins.netty.SoaInvokeCounter, com.github.dapeng.impl.plugins.netty.SoaMessageProcessor, com.github.dapeng.impl.plugins.netty.SoaMsgDecoder, com.github.dapeng.impl.plugins.netty.SoaMsgEncoder, com.github.dapeng.impl.plugins.netty.SoaServerHandler, com.github.dapeng.registry, com.github.dapeng.registry.zookeeper, com.github.dapeng.registry.zookeeper.RegistryAgentImpl, com.github.dapeng.registry.zookeeper.WatcherUtils, com.github.dapeng.registry.zookeeper.ZkClientAgentImpl, com.github.dapeng.registry.zookeeper.ZookeeperHelper, com.github.dapeng.registry.zookeeper.ZookeeperWatcher, com.github.dapeng.route, com.github.dapeng.route.RouteExecutor, com.github.dapeng.transaction, container, container.scheduled, container.scheduled.task, container.simple, container.simple.log, container.slowtime, container.slowtime.log, io, io.netty, io.netty.bootstrap, io.netty.bootstrap.Bootstrap, io.netty.bootstrap.ServerBootstrap, io.netty.buffer, io.netty.buffer.AbstractByteBuf, io.netty.buffer.AdvancedLeakAwareByteBuf, io.netty.buffer.ByteBufUtil, io.netty.buffer.PoolThreadCache, io.netty.buffer.PooledByteBufAllocator, io.netty.channel, io.netty.channel.AbstractChannel, io.netty.channel.AbstractChannelHandlerContext, io.netty.channel.ChannelInitializer, io.netty.channel.ChannelOutboundBuffer, io.netty.channel.DefaultChannelId, io.netty.channel.DefaultChannelPipeline, io.netty.channel.MultithreadEventLoopGroup, io.netty.channel.nio, io.netty.channel.nio.AbstractNioChannel, io.netty.channel.nio.NioEventLoop, io.netty.channel.socket, io.netty.channel.socket.nio, io.netty.channel.socket.nio.NioServerSocketChannel, io.netty.channel.socket.nio.NioSocketChannel, io.netty.resolver, io.netty.resolver.AddressResolverGroup, io.netty.util, io.netty.util.NetUtil, io.netty.util.Recycler, io.netty.util.ReferenceCountUtil, io.netty.util.ResourceLeakDetector, io.netty.util.ResourceLeakDetectorFactory, io.netty.util.concurrent, io.netty.util.concurrent.AbstractEventExecutor, io.netty.util.concurrent.DefaultPromise, io.netty.util.concurrent.DefaultPromise.rejectedExecution, io.netty.util.concurrent.GlobalEventExecutor, io.netty.util.concurrent.SingleThreadEventExecutor, io.netty.util.internal, io.netty.util.internal.CleanerJava6, io.netty.util.internal.InternalThreadLocalMap, io.netty.util.internal.MacAddressUtil, io.netty.util.internal.PlatformDependent, io.netty.util.internal.PlatformDependent0, io.netty.util.internal.SystemPropertyUtil, io.netty.util.internal.logging, io.netty.util.internal.logging.InternalLoggerFactory, org, org.apache, org.apache.zookeeper, org.apache.zookeeper.ClientCnxn, org.apache.zookeeper.ClientCnxnSocket, org.apache.zookeeper.ClientCnxnSocketNIO, org.apache.zookeeper.CreateMode, org.apache.zookeeper.ZooKeeper, org.apache.zookeeper.client, org.apache.zookeeper.client.StaticHostProvider, org.apache.zookeeper.client.ZooKeeperSaslClient, org.apache.zookeeper.server, org.apache.zookeeper.server.ZooKeeperThread]]
jmx-cli > exec bean:$0 op:getLoggerLevel params:ROOT
getLoggerLevel([ROOT]) : INFO
jmx-cli > exec bean:$0 op:setLoggerLevel params:["ROOT","DEBUG"]
setLoggerLevel([ROOT, DEBUG]) : void
``