void setMaxRetainSize(int maxRetainSize) { LOGGER_CONNECTION.warn("Unsafe method called. Use configuration parameters to set this value instead"); this.maxRetainSize = maxRetainSize; } }
/** * Creates and returns a new <tt>Logger</tt> bound to the given * <tt>binding</tt> type using * * @param binding the <tt>java.lang.Class</tt> to bind to * @return the <b>new</b> <tt>Logger</tt> instance */ static Logger getLogger(Class<?> binding) { return Holder.INST.defaultFactory.create(binding); }
/** * Sets the log level for Loggers that fits the initial path. Note that * class name are in the form "c.s.i.c.p.c.i.ConnectionPoolComponentImpl" * * @param path the start of the logger name that is to be changed * @param level the new log level */ static void setLevel(String path, Level level) { Holder.INST.defaultFactory.setLevel(path, level); }
@Override public <ENTITY> SqlStreamOptimizer<ENTITY> get(Pipeline initialPipeline, DbmsType dbmsType) { if (DEBUG.isEqualOrHigherThan(LOGGER_STREAM_OPTIMIZER.getLevel())) { LOGGER_STREAM_OPTIMIZER.debug("Evaluating %s pipeline: %s", initialPipeline.isParallel() ? "parallel" : "sequential", initialPipeline.toString()); } final SqlStreamOptimizer<ENTITY> result = getHelper(initialPipeline, dbmsType); if (DEBUG.isEqualOrHigherThan(LOGGER_STREAM_OPTIMIZER.getLevel())) { LOGGER_STREAM_OPTIMIZER.debug("Selected: %s", result.getClass().getSimpleName()); } return result; }
private <T> void actionSilently(final T actionTarget, ThrowingConsumer<T> action, String actionLabel) { try { if (actionTarget != null) { action.accept(actionTarget); } } catch (Exception e) { LOGGER.error(e, "Error " + actionLabel + " " + actionTarget); // Just log the error. No re-throw } }
private void debug(String action) { LOGGER.debug("Report node " + action); } }
protected void log(Level msgLevel, Throwable throwable, Supplier<String> supplier) { if (msgLevel.isEqualOrHigherThan(this.level)) { final String logMsg = supplier.get(); final String outputMessage = fixMessage(msgLevel, logMsg, throwable); output(outputMessage); if (!listeners.isEmpty()) { final LoggerEvent loggerEvent = new LoggerEventImpl(msgLevel, name, outputMessage); listeners.forEach(l -> l.accept(loggerEvent)); } } }
@Override public synchronized void setFormatter(LoggerFormatter formatter) { this.formatter = Objects.requireNonNull(formatter); forEachLogger(l -> l.setFormatter(formatter)); }
private void closeSilently(final AutoCloseable closeable) { actionSilently(closeable, AutoCloseable::close, "closing"); try { if (closeable != null) { closeable.close(); } } catch (Exception e) { LOGGER.error(e, "Error closing " + closeable); // Just log the error. No re-throw } }
void setMaxAge(long maxAge) { LOGGER_CONNECTION.warn("Unsafe method called. Use configuration parameters to set this value instead"); this.maxAge = maxAge; }
protected void logOperation(Logger logger, final String sql, final List<?> values) { logger.debug("%s, values:%s", sql, values); }
/** * Creates and returns a new <tt>Logger</tt> bound to the given * <tt>binding</tt> string using Platform's LoggerFactoryComponent. * * @param binding the <tt>java.lang.String</tt> to bind to * @return the <b>new</b> <tt>Logger</tt> instance */ static Logger getLogger(String binding) { return Holder.INST.defaultFactory.create(binding); }
/** * Sets the log level for the specified class logger. * * @param clazz of the class logger * @param level the new log level */ static void setLevel(Class<?> clazz, Level level) { Holder.INST.defaultFactory.setLevel(clazz, level); }
protected int finallyCloseInt(IntSupplier is) { try { return is.getAsInt(); } catch (Exception e) { LOGGER.error(e); throw e; } finally { close(); } }
public static void trip(Class<?> trippingClass, String msg) { LOGGER.warn(trippingClass.getName() + ", " + msg); }
@Override public void rawClose() throws SQLException { LOGGER_CONNECTION.debug("Closed external connection: %s", connection); connection.close(); }
protected double finallyCloseDouble(DoubleSupplier ds) { try { return ds.getAsDouble(); } catch (Exception e) { LOGGER.error(e); throw e; } finally { close(); } }