code: @Override
      public void aroundWriteTo(final WriterInterceptorContext writerInterceptorContext)
              throws IOException, WebApplicationException {
          final LoggingStream stream = (LoggingStream) writerInterceptorContext.getProperty(ENTITY_LOGGER_PROPERTY);
          writerInterceptorContext.proceed();
  
          final Object requestId = Requests.getProperty(LOGGING_ID_PROPERTY);
          final long id = requestId != null ? (Long) requestId : _id.incrementAndGet();
          StringBuilder b = (StringBuilder) writerInterceptorContext.getProperty(LOGGER_BUFFER_PROPERTY);
          if (b == null) {
              b = new StringBuilder();
              writerInterceptorContext.setProperty(LOGGER_BUFFER_PROPERTY, b);
          }
          printPrefixedHeaders(b, id, RESPONSE_PREFIX, HeaderUtils.asStringHeaders(writerInterceptorContext.getHeaders()));
  
          if (stream != null) {
              log(stream.getStringBuilder(MessageUtils.getCharset(writerInterceptorContext.getMediaType())));
          } else {
              log(b);
          }
      }
docs: {@inheritDoc}