Hi,

i changed Logger class:

public static void configure() {
        String factoryName = System.getProperty("openejb.log.factory");
        Class<?> factoryClass = null;
        if (factoryName != null) {
            ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
            if (classLoader != null) {
                try {
                    factoryClass = classLoader.loadClass(factoryName);
                } catch (ClassNotFoundException e) {
                }
            }

            if (factoryClass == null) {
                try {
                    factoryClass = Class.forName(factoryName);
                } catch (ClassNotFoundException e) {
                }
            }
        }

        LogStreamFactory factory = null;
        if (factoryClass != null) {
            try {
                factory = (LogStreamFactory) factoryClass.newInstance();
            } catch (Exception e) {
            }
        }

        // slf4j
        if (factory == null) {
            try {
                // ensure Log4j is in the CP

Logger.class.getClassLoader().loadClass("org.slf4j.LoggerFactory");
                if
(!System.getProperties().containsKey("org.apache.cxf.Logger")) {
                    System.setProperty("org.apache.cxf.Logger",
"org.apache.cxf.common.logging.Slf4jLogger");
                }
                factory = new Slf4jLogStreamFactory();
            } catch (NoClassDefFoundError e) {
                // slf4j not in classpath
            } catch (ClassNotFoundException cnfe) {
                // idem
            }
        }

        // Log4j is possible
        if (factory == null) {
            try {
                // ensure Log4j is in the CP

Logger.class.getClassLoader().loadClass("org.apache.log4j.Layout");
                if
(!System.getProperties().containsKey("org.apache.cxf.Logger")) {
                    System.setProperty("org.apache.cxf.Logger",
"org.apache.cxf.common.logging.Log4jLogger");
                }
                factory = new Log4jLogStreamFactory();
            } catch (NoClassDefFoundError e) {
                //log4j not in classpath
            } catch (ClassNotFoundException cnfe) {
                // idem
            }
        }

        // else JUL
        if (factory == null) {
            factory = new JuliLogStreamFactory();
        }

        logStreamFactory = factory;
    }



- Romain


2011/12/6 AndyG <[email protected]>

> Does anyone know what has changed on the logging front to break logging -
> Using standalone server. Does not even create the 'openejb.log' anymore?
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Logging-broken-tp4164685p4164685.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Reply via email to