All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.browseengine.bobo.server.qlog.QueryLog Maven / Gradle / Ivy

Go to download

Bobo is a Faceted Search implementation written purely in Java, an extension of Apache Lucene

The newest version!
package com.browseengine.bobo.server.qlog;

import org.apache.log4j.Logger;

public class QueryLog {
  private static Logger logger = Logger.getLogger(QueryLog.class);

  public static class LogLine {
    String protocol;
    String method;
    String request;

    private LogLine() {

    }

    public String getMethod() {
      return method;
    }

    public String getProtocol() {
      return protocol;
    }

    public String getRequest() {
      return request;
    }

  }

  public static void logQuery(String request) {
    logger.info(request);
  }

  public static LogLine readLog(String line) {

    LogLine log = new LogLine();
    int index = line.indexOf('#');
    if (index != -1) {
      String header = line.substring(0, index);
      log.request = line.substring(index + 1, line.length());

      String[] parts = header.split("/");
      log.protocol = parts[0];
      log.method = parts[1];

    }
    return log;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy