@Override public void logSQL(int connectionId, String now, long elapsed, Category category, String prepared, String sql, String url) { logText(strategy.formatMessage(connectionId, now, elapsed, category.toString(), prepared, sql, url)); }
public static synchronized void initialize() { final P6ModuleManager moduleManager = P6ModuleManager.getInstance(); if (null == moduleManager) { // not initialized yet => can't proceed return; } final P6SpyOptions opts = moduleManager.getOptions(P6SpyOptions.class); logger = opts.getAppenderInstance(); if (logger != null) { if (logger instanceof FileLogger) { final String logfile = opts.getLogfile(); ((FileLogger) logger).setLogfile(logfile); } if (logger instanceof FormattedLogger) { final MessageFormattingStrategy strategy = opts.getLogMessageFormatInstance(); if (strategy != null) { ((FormattedLogger) logger).setStrategy(strategy); } } } }
public static synchronized void initialize() { final P6ModuleManager moduleManager = P6ModuleManager.getInstance(); if (null == moduleManager) { // not initialized yet => can't proceed return; } final P6SpyOptions opts = moduleManager.getOptions(P6SpyOptions.class); logger = opts.getAppenderInstance(); if (logger != null) { if (logger instanceof FileLogger) { final String logfile = opts.getLogfile(); ((FileLogger) logger).setLogfile(logfile); } if (logger instanceof FormattedLogger) { final MessageFormattingStrategy strategy = opts.getLogMessageFormatInstance(); if (strategy != null) { ((FormattedLogger) logger).setStrategy(strategy); } } } }
@Override public void logSQL(int connectionId, String now, long elapsed, Category category, String prepared, String sql, String url) { logText(strategy.formatMessage(connectionId, now, elapsed, category.toString(), prepared, sql, url)); }