【发布时间】:2016-12-01 10:38:42
【问题描述】:
如何在骆驼中启用 http 日志?我正在使用rest-dsl。我想查看每个请求和响应的 http 标头和正文我的代码:
restConfiguration()
.component("jetty")
.host("0.0.0.0")
.port(port)
.scheme("https")
.bindingMode(RestBindingMode.json)
.dataFormatProperty("json.in.disableFeatures", "FAIL_ON_UNKNOWN_PROPERTIES")
.dataFormatProperty("json.in.enableFeatures", "FAIL_ON_NULL_FOR_PRIMITIVES")
.componentProperty("sslKeyPassword", KEYSTORE_PASSWORD)
.componentProperty("sslKeystore", KEYSTORE)
.componentProperty("sslPassword", KEYSTORE_PASSWORD)
.enableCORS(true)
.componentProperty("traceEnabled", "true")
// swagger
.apiContextPath("api-doc")
.apiProperty("api.title", "Mobile Api").apiProperty("api.version", "v1.0")
.apiProperty("schemes", "https")
;
和
rest(MOBILE_API_PATH).produces("application/json").consumes("application/json")
.post("/transaction").type(MobileTransactionRequest.class).outType(MobileTransactionResponse.class)
.to("direct:mobileTransaction")
【问题讨论】:
标签: json rest logging apache-camel