[英]Dropwizard jackson yaml configuration mapping
使用dropwizard 0.9.2版和配置yml看起來像這樣
server:
applicationConnectors:
- type: http
port: 8090
adminConnectors:
- type: http
port: 8091
requestLog:
timeZone: UTC
appenders:
- type: file
currentLogFilename: file
threshold: ALL
archive: true
archivedLogFilenamePattern: some-pattern
archivedFileCount: 5
maxFileSize: 10MB
執行時出現以下錯誤
* Unrecognized field at: server.requestLog
Did you mean?:
- adminConnectors
- adminContextPath
- adminMaxThreads
在搜索時似乎此錯誤在Jackson中已知,並已在2.7.3中修復。 因此,將dropwizard升級到最新的1.0.2,但問題仍然存在。
另外,嘗試明確地排除傑克遜並包含最新的2.8.3也沒有幫助。 在解決這個問題上有什么投入嗎?
嘗試過的pom
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>0.9.2</version>
<exclusions>
<exclusion>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jackson</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jackson</artifactId>
<version>1.0.2</version>
</dependency>
日志記錄不是服務器配置的一部分。
server:
applicationConnectors:
- type: http
port: 8090
adminConnectors:
- type: http
port: 8091
logging:
level: INFO
loggers:
requestLog: INFO
appenders:
使用“日志記錄”代替
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.