Why Only IP is Logged for Upstream
- Upstream Targets Are Resolved to IPs
- When you define an upstream with a hostname and add targets, Kong internally resolves the hostname to an IP using DNS and then proxies to that IP.
- Kong logs the resolved IP address, not the hostname, to provide the actual connection endpoint for traceability.
- Performance and Audit Reasons
- Logging IPs ensures consistency across distributed deployments, since DNS entries may change over time.
- IPs provide exact traceability in debugging and auditing upstream behavior.
- DNS Caching and TTL
- Kong caches DNS results. Once a hostname is resolved to an IP, that IP is used and logged during the TTL window.
- No Custom Log Format or Plugin in Use
- By default, Kong does not resolve or log upstream hostnames unless a custom plugin or log transformer is used.