2013-10-10 109 views
0

我有一個restify API審計記錄器插件設置,我可以選擇也將日誌身體設置爲true,但我希望能夠過濾或刪除身體上發送的參數和標題,如密碼或令牌,目前正在restify的日誌中保存。restify日誌上的過濾器參數

當前日誌的例子:我想什麼

req: { 
    "headers": { 
      "authorization": "Token token=**youshouldnotseeme**,provider=**hellno**", 
      "date": "Wed, 09 Oct 2013 17:10:53 GMT", 
      "host": "localhost:8082", 
      "connection": "keep-alive" 
    } 
    "body": { 
      "username": "somedude", 
      "password": "**youshouldnotseeme**" 
    } 
} 

例子:

req: { 
    "headers": { 
      "authorization": "Token token=**[FILTERED]**,provider=**[FILTERED]**", 
      "date": "Wed, 09 Oct 2013 17:10:53 GMT", 
      "host": "localhost:8082", 
      "connection": "keep-alive" 
    } 
    "body": { 
      "username": "somedude", 
      "password": "**[FILTERED]**" 
    } 
} 

那麼我將如何能夠實現這一目標?

謝謝。

回答