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());
}
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);
}
Aggregations