for (Method method : methods) {
//ensure method exists
if (method.getName().equals("getContextSelector")) {
//System.out.println("Logger context selector method found");
//get the context selector
StaticLoggerBinder binder = StaticLoggerBinder.getSingleton();
Method m1 = binder.getClass().getMethod("getContextSelector", (Class[]) null);
ContextSelector selector = (ContextSelector) m1.invoke(binder, (Object[]) null);
//get the context for the given context name or default if null
LoggerContext ctx = null;
if (contextName != null && contextName.length() > 0) {
ctx = selector.getLoggerContext(contextName);