2015-09-15 26 views
0

我已經在我的配置文件中使用了以下內容,仍然在access.log中獲得標準服務器日誌,有沒有辦法修改它? Dropwizard版本0.7有沒有一種方法來logformat Dropwizard access.log

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 

回答

0

你需要把部分「服務器」下(比如你有),像這樣:

server: 
    requestLog: 
    appenders: 
     - type: console 
     threshold: ALL 
     logFormat: '%h [%date{ISO8601}] "%r" %s %b %D [%i{User-Agent}]' 

你需要使用一個「新」版本(我從0.9.something想)獲取logFormat的東西工作。

我認爲這是因爲他們從Jetty訪問日誌實現更改爲在較新版本中使用logback訪問(http://logback.qos.ch/access.html)。

相關問題