private void initializeViaInitMethod(Handler<?> handler, Map<String, String> params, Method init) { try { init.invoke(handler, params); } catch (InvocationTargetException ex) { Throwable t = ex.getCause() != null ? ex.getCause() : ex; LogUtils.log(LOG, Level.WARNING, "INIT_METHOD_THREW_EXCEPTION", t, handler.getClass()); } catch (IllegalAccessException ex) { LOG.log(Level.SEVERE, "CANNOT_ACCESS_INIT", handler.getClass()); } }
@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 void entering(String sourceClass, String sourceMethod, Object param1) { if (isLoggable(Level.FINER)) { Object[] params = {param1 }; logp(Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params); } }
private static boolean skipHack(final String key) { return skipHack(key, "false"); } private static boolean skipHack(final String key, String def) {
public CharSequence filter(CharSequence command) { if (regPattern != null) { command = new ReplaceRegEx(regPattern, regGroup, regReplacement).filter(command); } for (ReplaceRegEx regex : regexs) { command = regex.filter(command); } return command; }
private Socket enableCipherSuites(Socket s, Object[] logParams) { SSLSocket socket = (SSLSocket)s; if (socket == null) { LogUtils.log(LOG, Level.SEVERE, "PROBLEM_CREATING_OUTBOUND_REQUEST_SOCKET", logParams); return socket; } if (protocol != null) { String[] p = findProtocols(protocol, socket.getSupportedProtocols()); if (p != null) { socket.setEnabledProtocols(p); } } if (ciphers != null) { socket.setEnabledCipherSuites(ciphers); } return socket; } private String[] findProtocols(String p, String[] options) {
public void exiting(String sourceClass, String sourceMethod, Object result) { if (isLoggable(Level.FINER)) { Object[] params = {result }; logp(Level.FINER, sourceClass, sourceMethod, "RETURN {0}", params); } }
/** * Checks log level and logs * * @param logger the Logger the log to * @param level the severity level * @param message the log message */ public static void log(Logger logger, Level level, String message) { log(logger, level, message, NO_PARAMETERS); }
public void exiting(String sourceClass, String sourceMethod, Object result) { if (isLoggable(Level.FINER)) { Object params[] = {result }; logp(Level.FINER, sourceClass, sourceMethod, "RETURN {0}", params); } }
/** * Checks log level and logs * * @param logger the Logger the log to * @param level the severity level * @param message the log message */ public static void log(Logger logger, Level level, String message) { log(logger, level, message, NO_PARAMETERS); }
public void entering(String sourceClass, String sourceMethod) { if (isLoggable(Level.FINER)) { logp(Level.FINER, sourceClass, sourceMethod, "ENTRY"); } }
/** * Checks log level and logs * * @param logger the Logger the log to * @param level the severity level * @param message the log message */ public static void log(Logger logger, Level level, String message) { log(logger, level, message, NO_PARAMETERS); }
public void exiting(String sourceClass, String sourceMethod, Object result) { if (isLoggable(Level.FINER)) { Object params[] = {result }; logp(Level.FINER, sourceClass, sourceMethod, "RETURN {0}", params); } }
/** * Checks log level and logs * * @param logger the Logger the log to * @param level the severity level * @param message the log message */ public static void log(Logger logger, Level level, String message) { log(logger, level, message, NO_PARAMETERS); }
public void exiting(String sourceClass, String sourceMethod, Object result) { if (isLoggable(Level.FINER)) { Object params[] = {result }; logp(Level.FINER, sourceClass, sourceMethod, "RETURN {0}", params); } }
/** * Checks log level and logs * * @param logger the Logger the log to * @param level the severity level * @param message the log message */ public static void log(Logger logger, Level level, String message) { log(logger, level, message, NO_PARAMETERS); }
public void entering(String sourceClass, String sourceMethod) { if (isLoggable(Level.FINER)) { logp(Level.FINER, sourceClass, sourceMethod, "ENTRY"); } }
public void exiting(String sourceClass, String sourceMethod) { if (isLoggable(Level.FINER)) { logp(Level.FINER, sourceClass, sourceMethod, "RETURN"); } }
public void entering(String sourceClass, String sourceMethod) { if (isLoggable(Level.FINER)) { logp(Level.FINER, sourceClass, sourceMethod, "ENTRY"); } }
public void exiting(String sourceClass, String sourceMethod) { if (isLoggable(Level.FINER)) { logp(Level.FINER, sourceClass, sourceMethod, "RETURN"); } }