Search This Blog

Sunday, June 30, 2013

get ADF Logger root directory at runtime

ADFLogger logger;

logger = ADFLogger.createADFLogger(MyClass.class);

InitialContext ctx = new InitialContext();
           
MBeanServer server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
        
ObjectName service =new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.
runtime.RuntimeServiceMBean");

ObjectName domain =(ObjectName)server.getAttribute(service, "DomainConfiguration");

rootDir = (String)server.getAttribute(domain, "RootDirectory");

logger.info("Root Dir : " + rootDir);

No comments:

Post a Comment