LoggerFactory { public static void setDateFormatString(String dateFormatString) { LoggerFactory.dateFormatString = dateFormatString; LoggerFactory.formatter = FastDateFormat.getInstance(dateFormatString); }  static void setDateFormatString(String dateFormatString); static void setIncludeLoggerName(boolean includeLoggerName); static void setIncludeThreadName(boolean includeThreadName); static void setIncludeClassName(boolean includeClassName); static boolean isIncludeLoggerName(); static boolean isIncludeThreadName(); static boolean isIncludeClassName(); static Logger getLogger(String name); static Logger getLogger(Class<?> clazz);  }
@Test public void testSetDateFormatString() throws Exception { LoggerFactory.setDateFormatString("HH:MM"); Field formatterField = LoggerFactory.class.getDeclaredField("formatter"); formatterField.setAccessible(true); FastDateFormat formatter = (FastDateFormat) formatterField.get(null); assertEquals("HH:MM", formatter.getPattern()); }