Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jetty 有没有办法对Dropwizard access.log进行日志格式化_Jetty_Dropwizard - Fatal编程技术网

Jetty 有没有办法对Dropwizard access.log进行日志格式化

Jetty 有没有办法对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

我在我的配置文件中使用了以下内容,但我仍然在access.log中获取标准服务器日志,是否有方法修改它?Dropwizard版本0.7

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()