Package org.apache.juli.logging

Examples of org.apache.juli.logging.LogFactory


        try {
            final ClassLoader tccl = thread.getContextClassLoader(); // this is in classpath not StandardClassLoader so use reflection
            final Class<?> logger = tccl.loadClass("org.apache.openejb.util.Logger");
            final Method m = logger.getDeclaredMethod("delegateClass");
            final String clazz = (String) m.invoke(null);
            final LogFactory factory;
            if ("org.apache.openejb.util.Log4jLogStreamFactory".equals(clazz)) {
                factory = LogFactory.class.cast(tccl.loadClass("org.apache.tomee.loader.log.Log4jLogFactory").newInstance());
            } else if ("org.apache.openejb.util.Slf4jLogStreamFactory".equals(clazz)) {
                factory = LogFactory.class.cast(tccl.loadClass("org.apache.tomee.loader.log.Slf4jLogFactory").newInstance());
            } else {
                factory = null;
            }
            if (factory != null) {
                final LogFactory oldFactory = getFactory();
                final Collection<String> names = new ArrayList<String>(oldFactory.getNames());
                oldFactory.getNames().clear();
                oldFactory.release();
                setSingleton(factory);
                reload(factory, tccl, names);
            }
        } catch (final Throwable th) {
            System.err.println(th.getClass().getName() + ": " + th.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.juli.logging.LogFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.