Search This Blog

Showing posts with label Code to find the ADF log file programatically. Show all posts
Showing posts with label Code to find the ADF log file programatically. Show all posts

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);