Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Setting the logging level in running J2EE app

My EclipseLink-based application is running within Weblogic and I would like to temporarily reset the logging level while the application is running so I can debug it.    Is there a way to programmatically change the logging level on an existing EntityManager or EntityManagerFactory?    My first attempt is shown below where I set the “eclipselink.logging.level.sql” property on the EntityManager.

 

    public static void setPropertiesOnEntityManager(EntityManager entityManager, final Map<String, Object> properties) {

 

        if (properties != null && !properties.isEmpty()) {

            ((org.eclipse.persistence.internal.jpa.EntityManagerImpl)entityManager.getDelegate()).setProperties(properties);   

            

            DynamicHelper helper = new JPADynamicHelper(entityManager);

            for (Map.Entry<String, Object> entry : properties.entrySet()) {

                helper.getSession().setProperty(entry.getKey(), entry.getValue());

            }

        }

    }

 

Any help or suggestions is greatly appreciated.  Thanks

Dennis Fuglsang

 


Back to the top