配置JsonProcessingExceptionMapper以登录Dropwizard

时间:2018-03-23 08:26:01

标签: json jackson jersey dropwizard

我正在开发一个dropwizard应用程序。我需要将其配置为从JsonProcessingExceptionMapper记录异常。

我的一些config.yml文件:

server:

type: simple

connector:
  type: http
  port: 0

requestLog:
  appenders: []

registerDefaultExceptionMappers: true

一直在查看JsonProcessingExceptionMapper及其showDetail财产,但无法弄明白。我正在使用dropwizard 1.2.3版

1 个答案:

答案 0 :(得分:3)

找到它。我错过了属性detailedJsonProcessingExceptionMapper

server
  registerDefaultExceptionMappers: true
  detailedJsonProcessingExceptionMapper: true

在文档中找不到这个。谁能指引我到正确的地方?