自从我从dropwizard-core 0.7.1移动到1.0.0后,我一直面临运行时错误,如下所示 -
/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java /Users/xyz/GitHub/test-service/config/next/config.yml has an error: * when archivedLogFilenamePattern contains %i, maxFileSize must be specified
问题是,即使我对 config.yml 进行了相应的更改并成功编译了项目。仍然在尝试运行该项目时,我遇到了同样的错误。
配置.yml
server:
applicationConnectors:
- type: http
port: 8180
adminConnectors:
- type: http
port: 8181
requestLog:
appenders:
- type: file-size-rolled
currentLogFilename: /var/log/test-service/access.log
threshold: ALL
archive: true
archivedLogFilenamePattern: /var/log/test-service/access.%i.log.gz
maxFileSize: 50MB
archivedFileCount: 10
timeZone: IST
logging:
level: INFO
loggers:
io.dropwizard: INFO
appenders:
- type: console
threshold: ALL
timeZone: IST
target: stdout
- type: file-size-rolled
threshold: ALL
currentLogFilename: /var/log/test-document-service/test-service.log
threshold: ALL
archive: true
archivedLogFilenamePattern: /var/log/test-service/test-service-%i.log.gz
maxFileSize: 50MB
archivedFileCount: 5
timeZone: IST
如果需要,file-size-rolled
定义如下 -
@JsonTypeName("file-size-rolled")
public class SizeBasedRollingFileAppenderFactory extends FileAppenderFactory {
public static final Size DEFAULT_MAX_FILE_SIZE_STR = Size.parse("50MB") ;
@NotNull
@JsonProperty
Size maxFileSize = DEFAULT_MAX_FILE_SIZE_STR;
我在这里缺少与版本升级相关的哪些更改?