code: protected static void doLog(int connectionId, long elapsedNanos, Category category, String prepared, String sql, String url) {
  	    // give it one more try if not initialized yet
  	    if (logger == null) {
  	      initialize();
  	      if (logger == null) {
  	    	  return;
  	      }
  	    }
      
        final String format = P6SpyOptions.getActiveInstance().getDateformat();
        final String stringNow;
        if (format == null) {
          stringNow = Long.toString(System.currentTimeMillis());
        } else {
          stringNow = new SimpleDateFormat(format).format(new java.util.Date()).trim();
        }
  
        logger.logSQL(connectionId, stringNow, TimeUnit.NANOSECONDS.toMillis(elapsedNanos), category, prepared, sql, url);
  
        final boolean stackTrace = P6SpyOptions.getActiveInstance().getStackTrace();
        if (stackTrace) {
  	    final String stackTraceClass = P6SpyOptions.getActiveInstance().getStackTraceClass();
      	Exception e = new Exception();
          if (stackTraceClass != null) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            e.printStackTrace(pw);
            String stack = sw.toString();
            if (stack.indexOf(stackTraceClass) == -1) {
              e = null;
            }
          }
          if (e != null) {
            logger.logException(e);
          }
        }
    }
docs: Writes log information provided.
  
  @param connectionId
  @param elapsedNanos
  @param category
  @param prepared
  @param sql
  @param url