Quantcast
Channel: Akka Libraries - Discussion Forum for Akka technologies
Viewing all articles
Browse latest Browse all 1367

How can I establish root cause of rejection when empty list is provided

$
0
0

Hello everyone,

I have a question about akka-http logRequestResult directive. I’ve added to it function like below to log on debug successful responses, on info error responses and rejections:

  private def requestBasicInfoAndResponseStatus(req: HttpRequest): RouteResult => Option[LogEntry] = {
    case RouteResult.Complete(res) if res.status.isFailure() => Some(
      LogEntry(s"Request ${req.method} to ${req.uri} resulted in failure with status ${res.status}", Logging.InfoLevel)
    )
    case RouteResult.Complete(res) => Some(
      LogEntry(s"Request ${req.method} to ${req.uri} resulted in response with status ${res.status}", Logging.DebugLevel)
    )
    case RouteResult.Rejected(rejections) => Some(
      LogEntry(s"Request ${req.method} to ${req.uri} was rejected with rejections: $rejections", Logging.InfoLevel)
    )
  }

in logs I see very often

Request HttpMethod(POST/GET/PATCH) to http://URL/PATH was rejected with rejections: List()

I’ve read in docu that empty rejection list could be related to no routing for given path, but that is not the case - provided (path, method) is covered by Route. Is there any way to determine why it happens?

Thanks in advance for any suggestions and help :slight_smile:

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1367

Trending Articles