WebClient Netty Logging

Kevin Park
Apr 19, 2021

--

안녕하세요. Kevin 입니다.

스프링 WebClinet 사용 시 WebClint에 대한 로그가 예쁘게 나오지 않았었는데요. reactor 1.0.0 부터 AdvancedByteBufFormat.TEXTUAL 가 제공 되어 조금 더 plan text로 로그를 확인 할 수 있습니다. AdvancedByteBufFormat에는 SIMPLE, HEX_DUMP, TEXTUAL 3가지 타입을 ENUM으로 제공하고 있습니다.

그럼 WebClient 설정 시 AdvancedByteBufFormat.TEXTUAL 적용 하는 방법과 Proxy를 적용하는 방법 두가지로 작성해 보았습니다. WebClient는 JVM에 설정한 Proxy Properties를 이용하지 않기 때문에 Proxy가 필요한 경우 WebClient에 직접 설정 해주어야 합니다.

wiretap에 첫번째 파라미터 category가 logger가 표시 해주는 category가 됩니다.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Kevin Park
Kevin Park

No responses yet

Write a response