zalando/logbook

Allow replacing Default logging Keys

nishanb opened this issue · 0 comments

I have logbook integrated with my spring application which has JsonHttpLogFormatter configured and prints log like below

2022-11-24T12:51:12,860 - TRACE: {"origin":"remote","type":"request","correlation":"d9d09687bced24f6","protocol":"HTTP/1.1","remote":"0:0:0:0:0:0:0:1","method":"GET","uri":"http://localhost:8080/api/v1/client/633a918bb022283261d58ae9/","host":"localhost","path":"/api/v1/client/633a918bb022283261d58ae9/","scheme":"http","port":"8080","headers":{"accept":["*/*"],"accept-encoding":["gzip, deflate, br"],"authorization":["XXX"],"cache-control":["no-cache"],"connection":["keep-alive"],"host":["localhost:8080"],"user-agent":["PostmanRuntime/7.29.2"]},"body":"\"\""}

I want to replace type from request to REQUESTED while logging, and some other fields too

Expected :

2022-11-24T12:51:12,860 - TRACE: {"origin":"remote","type":"REQUSTED","correlation":"d9d09687bced24f6","protocol":"HTTP/1.1","remote":"0:0:0:0:0:0:0:1","method":"GET","uri":"http://localhost:8080/api/v1/client/633a918bb022283261d58ae9/","host":"localhost","path":"/api/v1/client/633a918bb022283261d58ae9/","scheme":"http","port":"8080","headers":{"accept":["*/*"],"accept-encoding":["gzip, deflate, br"],"authorization":["XXX"],"cache-control":["no-cache"],"connection":["keep-alive"],"host":["localhost:8080"],"user-agent":["PostmanRuntime/7.29.2"]},"body":"\"\""}

Thanks in advance, any help is appreciated.