logbook icon indicating copy to clipboard operation
logbook copied to clipboard

Support for ANSI colors

Open mimly-wkit opened this issue 1 year ago • 2 comments

Is it possible to customize the HTTP log output, for example as below?

issue

DefaultHttpLogFormatter seems to not work this way:

2023-05-09T18:17:37.155+02:00 TRACE 18434 --- [nio-8989-exec-4] org.zalando.logbook.Logbook              : Incoming Request: f3f81601ffef19ed
Remote: 127.0.0.1
POST http://localhost:8989/api/login HTTP/1.1
accept: */*
content-length: 31
content-type: application/json
host: localhost:8989
user-agent: curl/8.0.1

{"username":"a","password":"b"}

mimly-wkit avatar May 09 '23 16:05 mimly-wkit

In order to prioritize the support for Logbook, we would like to check whether the old issues are still relevant. This issue has not been updated for over six months.

  • Please check if it is still relevant in latest version of the Logbook.
  • If so, please add a descriptive comment to keep the issue open.
  • Otherwise, the issue will automatically be closed after a week.

github-actions[bot] avatar Nov 13 '23 01:11 github-actions[bot]

It is possible to write your own implementation of HttpLogFormatter and have colors defined there. If you're using Spring, just having a bean of type HttpLogFormatter will be sufficient.

kasmarian avatar Nov 13 '23 08:11 kasmarian

This issue has automatically been closed due to no activities. If the issue still exists in the latest version of the Logbook, please feel free to re-open it.

github-actions[bot] avatar Mar 18 '24 01:03 github-actions[bot]