For logging purposes we want to intercept any rout...
# ktor
f
For logging purposes we want to intercept any routed or non-routed call. in the interceptor we want to know the final status code of the response (200, 404, 500...) The problem is, we can not differentiate between a 404 and a 500 because in case an exception is thrown, call.response.status is always null. We currently intercept via
Copy code
override fun install(pipeline: Application, configure: Unit.() -> Unit) {
    val loggingPhase = PipelinePhase("Logging")
    pipeline.phases.insertBefore(ApplicationCallPipeline.Infrastructure, loggingPhase)
    pipeline.intercept(loggingPhase) { call ->
      try {
        proceed()
      } finally {
        logCallFinished(call)
      }
    }
  }
Does Ktor supports the needed kind of logging/intercepting?