Jetty 有没有办法对Dropwizard access.log进行日志格式化
我在我的配置文件中使用了以下内容,但我仍然在access.log中获取标准服务器日志,是否有方法修改它?Dropwizard版本0.7Jetty 有没有办法对Dropwizard access.log进行日志格式化,jetty,dropwizard,Jetty,Dropwizard,我在我的配置文件中使用了以下内容,但我仍然在access.log中获取标准服务器日志,是否有方法修改它?Dropwizard版本0.7 server: adminConnectors: - port: 8889 type: http applicationConnectors: - acceptorThreads: 7 port: 8888 selectorThreads: 14 type: http
server:
adminConnectors:
-
port: 8889
type: http
applicationConnectors:
-
acceptorThreads: 7
port: 8888
selectorThreads: 14
type: http
maxQueuedRequests: 1024
maxThreads: 1024
requestLog:
appenders:
-
archive: true
archivedFileCount: 3
archivedLogFilenamePattern: /var/log/access-%i.log
currentLogFilename: /var/log/access.log
logFormat: '[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level]'
maxFileSize: 200MB
threshold: ALL
timeZone: IST
type: file-size-rolled
timeZone: IST
您需要将该部分放在“服务器”下(就像您所做的那样),如下所示:
server:
requestLog:
appenders:
- type: console
threshold: ALL
logFormat: '%h [%date{ISO8601}] "%r" %s %b %D [%i{User-Agent}]'
和您需要使用一个“更新”的版本(我认为是0.9版的)来让logFormat工作起来
我认为这是因为他们在新版本中从Jetty access日志实现改为使用logback access()