HttpLoggingInterceptor with Level.BODY blocks SSE from reading response
The problem is that SSE doesn't work with HttpLoggingInterceptor that have Level.BODY. Interceptor with other levels are working as expected.
HttpLoggingInterceptor with Level.BODY is not allowing RealEventSource to read response body byte by byte. It looks like interceptor is trying to buffer the entire response body which is not ready until request is done. Therefore Callback.onResponse in RealEventSource doesn't called, response events can't be parsed and passed to EventSourceListener.
The solution could be ignoring response body in HttpLoggingInterceptor for Content-Type: text/event-stream, reading response body line by line or just an explicit warning of not using Level.BODY with SEE in documentation.
Changing log level from Level.BODY for SSE client wouldn't be the best solution because it will also disable logging a body for regular HTTP requests for this client instance.
Want to send a PR for this?
I think we wanna change Level.BODY to do streaming-logging, not buffer-everything logging.
Won't fix. We have a minimal fix attitude to HttpLoggingInterceptor. It deserves it's own github library.