Search in sources :

Example 1 with CustomRequestLog

use of org.apache.hbase.thirdparty.org.eclipse.jetty.server.CustomRequestLog in project hbase by apache.

the class TestHttpRequestLog method testAppenderDefined.

@Test
public void testAppenderDefined() {
    RequestLog requestLog = HttpRequestLog.getRequestLog("test");
    assertNotNull("RequestLog should not be null", requestLog);
    assertThat(requestLog, instanceOf(CustomRequestLog.class));
    CustomRequestLog crl = (CustomRequestLog) requestLog;
    assertThat(crl.getWriter(), instanceOf(Slf4jRequestLogWriter.class));
    assertEquals(CustomRequestLog.EXTENDED_NCSA_FORMAT, crl.getFormatString());
}
Also used : RequestLog(org.apache.hbase.thirdparty.org.eclipse.jetty.server.RequestLog) CustomRequestLog(org.apache.hbase.thirdparty.org.eclipse.jetty.server.CustomRequestLog) CustomRequestLog(org.apache.hbase.thirdparty.org.eclipse.jetty.server.CustomRequestLog) Slf4jRequestLogWriter(org.apache.hbase.thirdparty.org.eclipse.jetty.server.Slf4jRequestLogWriter) Test(org.junit.Test)

Example 2 with CustomRequestLog

use of org.apache.hbase.thirdparty.org.eclipse.jetty.server.CustomRequestLog in project hbase by apache.

the class HttpRequestLog method getRequestLog.

public static RequestLog getRequestLog(String name) {
    String lookup = SERVER_TO_COMPONENT.get(name);
    if (lookup != null) {
        name = lookup;
    }
    String loggerName = "http.requests." + name;
    Slf4jRequestLogWriter writer = new Slf4jRequestLogWriter();
    writer.setLoggerName(loggerName);
    return new CustomRequestLog(writer, CustomRequestLog.EXTENDED_NCSA_FORMAT);
}
Also used : CustomRequestLog(org.apache.hbase.thirdparty.org.eclipse.jetty.server.CustomRequestLog) Slf4jRequestLogWriter(org.apache.hbase.thirdparty.org.eclipse.jetty.server.Slf4jRequestLogWriter)

Aggregations

CustomRequestLog (org.apache.hbase.thirdparty.org.eclipse.jetty.server.CustomRequestLog)2 Slf4jRequestLogWriter (org.apache.hbase.thirdparty.org.eclipse.jetty.server.Slf4jRequestLogWriter)2 RequestLog (org.apache.hbase.thirdparty.org.eclipse.jetty.server.RequestLog)1 Test (org.junit.Test)1