Course contentsShow
← Cloud and Infrastructure
Lesson 1637 of 2,98933. Service Mesh FeaturesFree lesson

Access Logging in Service Mesh

Configure sidecar proxy access logs to capture detailed request/response information.

Access Logging in Service Mesh

What you'll learn: How to configure sidecar proxy access logs to capture detailed request/response information for debugging and audit purposes.

What Are Access Logs?

Access logs are detailed records of every HTTP request and response that flows through your service mesh's sidecar proxies. Think of them as a detailed journal entry for each conversation between services—recording who called whom, when, what was requested, the response code, latency, and more.

Unlike the aggregated metrics you've already learned about, access logs provide individual transaction details. If metrics tell you "500 requests failed," access logs show you which exact requests failed, from where, and with what headers.

Configuring Access Logs

In a service mesh like Istio, you configure access logging at the sidecar proxy level (Envoy). You control:

  • Format: JSON, plain text, or custom templates
  • Destination: Standard output (stdout), files, or external log collectors
  • Fields: Which details to capture (method, path, status code, user agent, duration, etc.)
  • Verbosity: Log every request or sample selectively

For example, you might configure Envoy to output logs containing [%START_TIME%] %REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %RESPONSE_CODE% %DURATION%ms to capture timestamp, method, path, response code, and latency.

Use Cases

Access logs excel at:

  • Troubleshooting specific failed requests beyond what metrics show
  • Security auditing and compliance requirements
  • Understanding traffic patterns at the request level
  • Debugging authorization issues with specific headers or JWT claims

Key Takeaway: Access logs configured on sidecar proxies provide request-level visibility into service-to-service communication, complementing metrics and traces by capturing detailed transaction information for debugging, auditing, and analysis.