Add logging to test server
This commit is contained in:
parent
d70bbad6f1
commit
5b93affca1
|
@ -31,6 +31,7 @@ import ca.uhn.fhir.rest.server.RestfulServer;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.BanUnsupportedHttpMethodsInterceptor;
|
import ca.uhn.fhir.rest.server.interceptor.BanUnsupportedHttpMethodsInterceptor;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.CorsInterceptor;
|
import ca.uhn.fhir.rest.server.interceptor.CorsInterceptor;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.FhirPathFilterInterceptor;
|
import ca.uhn.fhir.rest.server.interceptor.FhirPathFilterInterceptor;
|
||||||
|
import ca.uhn.fhir.rest.server.interceptor.LoggingInterceptor;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
|
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
|
||||||
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||||
import ca.uhn.fhirtest.config.TestDstu2Config;
|
import ca.uhn.fhirtest.config.TestDstu2Config;
|
||||||
|
@ -274,6 +275,12 @@ public class TestRestfulServer extends RestfulServer {
|
||||||
* OpenAPI
|
* OpenAPI
|
||||||
*/
|
*/
|
||||||
registerInterceptor(new OpenApiInterceptor());
|
registerInterceptor(new OpenApiInterceptor());
|
||||||
|
|
||||||
|
// Logging for request type
|
||||||
|
LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
|
||||||
|
loggingInterceptor.setMessageFormat("ContentType / Accept for ${operationType}: ${requestHeader.content-type} / ${requestHeader.accept}");
|
||||||
|
registerInterceptor(loggingInterceptor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue