Envoy is a high-performance, open-source edge and service proxy designed for cloud-native applications. It is used to manage network traffic, providing features like load balancing, service discovery, and observability. One of its key functionalities is logging, which helps in monitoring and debugging network traffic.
When Envoy is not logging access, it can be challenging to track requests and responses passing through the proxy. This issue manifests as missing or incomplete access logs, which are crucial for auditing and troubleshooting network issues.
The root cause of Envoy not logging access is often a misconfiguration in the access log settings. This can occur if the log path is incorrect or if Envoy lacks the necessary permissions to write to the specified log file. Without proper configuration, Envoy cannot generate the expected access logs.
To resolve the issue of Envoy not logging access, follow these steps:
Check the Envoy configuration file (usually in YAML format) to ensure that the access log settings are correctly specified. Look for the access_log
field under the http_filters
section. Ensure the path is correct and the format is specified.
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
access_log:
- name: envoy.access_loggers.file
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
path: "/var/log/envoy/access.log"
format: "%START_TIME% %REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL% %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% %UPSTREAM_HOST%\n"
Ensure that the directory and file specified in the path
field are writable by the Envoy process. You can use the following command to change the ownership and permissions:
sudo chown envoy:envoy /var/log/envoy
sudo chmod 755 /var/log/envoy
After making changes to the configuration or permissions, restart the Envoy service to apply the changes. Use the following command:
sudo systemctl restart envoy
For more information on configuring Envoy access logs, refer to the Envoy Access Log Documentation. If you encounter further issues, consider visiting the Envoy Community Forum for support.
Let Dr. Droid create custom investigation plans for your infrastructure.
Book Demo