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

Log Formats and Customization

Customize log formats and fields to meet compliance and debugging requirements.

Log Formats and Customization

What You'll Learn

You'll learn how to customize service mesh log formats and fields to meet specific compliance, debugging, and operational requirements.

The Core Idea

Service mesh proxies (like Envoy) generate access logs automatically, but the default format may not capture everything you need for regulatory compliance, security audits, or troubleshooting complex issues. Log format customization lets you control exactly which fields appear in each log entry and how they're structured—whether as JSON for machine parsing, plain text for human readability, or custom formats for legacy systems.

Think of it like customizing a receipt: the store always prints something, but you might need itemized tax breakdowns, employee IDs, or transaction codes that aren't in the standard format. Similarly, you might need specific HTTP headers, latency percentiles, or upstream cluster names in your logs.

Common Customization Use Cases

Compliance Requirements: Financial or healthcare systems may require logging specific headers (like correlation IDs or user consent flags) for audit trails.

Debugging Needs: Adding upstream service names, retry counts, or circuit breaker states helps diagnose failures faster.

Performance Analysis: Including detailed timing breakdowns (DNS lookup time, TLS handshake duration) reveals bottlenecks.

Format Standards: Teams often standardize on JSON with specific field names so logs feed cleanly into Elasticsearch, Splunk, or other analysis tools.

How It Works

In Istio, you customize logs through the Telemetry resource or mesh configuration, specifying format strings with variables like %RESPONSE_CODE%, %DURATION%, or custom headers. You can switch between JSON and text formats, add or remove fields, and even apply filters to log only certain traffic patterns.

Key Takeaway: Customizing service mesh log formats transforms generic access logs into compliance-ready, debugging-optimized records tailored to your operational and regulatory needs.