How to log the host of Public Base URL instead of upstream host in custom access logging by Logging Policy

Solution Verified - Updated -

Issue

  • Logging Policy is enabled with the following custom logging format:

    [{{time_local}}] {{host}}:{{server_port}} {{http_x_forwarded_for}} {{remote_addr}}:{{remote_port}} \"{{request}}\" 
    {{status}} {{body_bytes_sent}} ({{request_time}}) {{post_action_impact}}
    

    {{host}} logs the host of upstream (backend). How can the host of Public Base URL of the product be logged like default access log?

  • In custom logging format of Logging policy, it specifies {{host}} in order to log the host accessed from a client.
    It works as expected when a request fails with error, such as 403(Authentication failed) and 429(Usage limit exceeded), but when a API request succeeds, the upstream host is logged instead.
    Is it possible to log the hostname of the product always?

Environment

  • Red Hat 3scale API Management Platform
    • 2.13 on-premises

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content