0 Replies Latest reply on Mar 28, 2018 12:50 AM by rakesh ranjan

    JBOSS 6.4 Logging Level Programmatically

    rakesh ranjan Newbie

      I am running JBOSS Eap 6.4 , I want to set log level dynamically by JBOSS MBean, I tried following code

      ObjectName objectName = new ObjectName("jboss.as:subsystem=logging,logger=com.test"); 
      MBeanServer server = java.lang.management.ManagementFactory.getPlatformMBeanServer();
      String[] signatures = new String[]{"java.lang.String.class"};
      Object[] args = new Object[]{level};
      String serviceName = "changeLogLevel";
      .invoke(objectName, serviceName, args, signatures);

      It works in standalone mode , but it says serviceName changeLogLevel not found when executed in domain mode.

      What can be the correct string to pass in ObjectName .