@BeforeClass public static void staticSetup() throws Exception { LogUtils.setLoggerClass(NullWebClientLogger.class); LOG_FILE = Files.createTempFile("tika-server-integration", ".xml"); Files.copy(TikaServerIntegrationTest.class.getResourceAsStream("/logging/log4j_child.xml"), LOG_FILE, StandardCopyOption.REPLACE_EXISTING); }
public static void initializeLoggingOnWriter(final Writer writer) { if (writer != null) { if (writer.getClass().getName().startsWith("org.jboss")) { // jboss writer will redirect to log4j which will cause an // infinite loop if we install an appender over this writer. // Continue logging via log4j and ignore this writer. LogUtils.setLoggerClass(Log4jLogger.class); return; } Logger cxfLogger = getRootCXFLogger(); // test if the stream handler were setted if (getHandler(cxfLogger, WRITER_HANDLER) == null) { final WriterHandler handler = new WriterHandler(writer); cxfLogger.addHandler(handler); } } }