Details
Description
After talking to Jeff Genender, I looked into the java.util.Logger code in the JDK a little to see if there was a way to improve the CXF Logger creation code a bit, particularly in OSGi. Things I found:
1) Logger.getLogger is a synchronized method so minimizing the time spent in there is good.
2) Setting the Thread contextClassLoader to the ClassLoader that loaded the class prior to the call makes it faster to determine the classloader to use for ResourceBundle lookup.
3) Loading the ResourceBundles can be expensive as it searches classloaders and such. Thus, moving that OUT of the synch block can help. Create the ResourceBundle, hold onto it strongly, and call getLogger and it can find it using a very fast map lookup.