简体   繁体   English

Dropwizard Jackson yaml配置映射

[英]Dropwizard jackson yaml configuration mapping

Using dropwizard version 0.9.2 and the configuration yml looks somewhat like this 使用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

While executing getting the following error 执行时出现以下错误

* Unrecognized field at: server.requestLog
    Did you mean?:
      - adminConnectors
      - adminContextPath
      - adminMaxThreads

On search seems like this error is known in Jackson and fixed in 2.7.3 . 在搜索时似乎此错误在Jackson中已知,并已在2.7.3中修复。 So, upgraded dropwizard to latest 1.0.2 but still the problem persists. 因此,将dropwizard升级到最新的1.0.2,但问题仍然存在。

Also, tried excluding jackson explicitly and include the latest 2.8.3 didn't help either. 另外,尝试明确地排除杰克逊并包含最新的2.8.3也没有帮助。 Any inputs on solving this issue ? 在解决这个问题上有什么投入吗?

Tried pom 尝试过的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>

Logging is not part of server configurations. 日志记录不是服务器配置的一部分。

server:
    applicationConnectors:
     - type: http
       port: 8090
    adminConnectors:
     - type: http
       port: 8091
logging:
  level: INFO
  loggers:
     requestLog: INFO
  appenders:

Use "logging" instead 使用“日志记录”代替

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM