Available in: v2.5.0+
View Release Notes →
Overview
Production-grade structured JSON logging with OpenTelemetry trace injection and support for 6 major log aggregation platforms.Supported Platforms
AWS CloudWatch
CloudWatch Logs + Metrics (EMF) + X-Ray
GCP Cloud Logging
Cloud Logging + Monitoring + Trace
Azure Monitor
Application Insights (unified)
Elasticsearch
ELK Stack with daily indices
Datadog
Unified APM, Logs, Metrics
Splunk
Enterprise or Observability Cloud
Structured JSON Logging
Features
- ✅ Automatic trace injection - trace_id and span_id in every log
- ✅ ISO 8601 timestamps with millisecond precision
- ✅ Exception stack traces in structured format
- ✅ Custom fields via logging.extra parameter
- ✅ Backward compatible - Can use text format with
LOG_FORMAT=text
Example Output
Configuration
AWS CloudWatch
Overview
Export logs to CloudWatch Logs, metrics to CloudWatch Metrics (via EMF), and traces to X-Ray.Prerequisites
- AWS Account with CloudWatch and X-Ray enabled
- IAM role with permissions (recommended) or access keys
Setup
1. Create IAM Policy
2. Configure Environment
3. Docker Compose
4. Kubernetes (EKS)
Configuration Details
Log Groups:/aws/mcp-server-langgraph/${ENVIRONMENT}
Log Streams: {service.name}/{hostname}
Metrics Namespace: MCPServer/${ENVIRONMENT}
Retention: Configure via AWS Console (default: Never expire)
Verification
GCP Cloud Logging
Overview
Export logs to Cloud Logging, metrics to Cloud Monitoring, and traces to Cloud Trace (unified exporter).Prerequisites
- GCP Project with Logging and Trace APIs enabled
- Service Account with permissions or Workload Identity
Setup
1. Create Service Account
2. Configure Environment
3. Docker Compose
4. Kubernetes (GKE with Workload Identity)
Configuration Details
Log Name:mcp-server-langgraph
Metric Prefix: custom.googleapis.com/mcp-server/
Resource Detection: Automatic (GKE, GCE, Cloud Run)
Verification
Azure Monitor
Overview
Export logs, metrics, and traces to Application Insights (unified).Prerequisites
- Azure subscription
- Application Insights resource created
Setup
1. Create Application Insights
2. Configure Environment
3. Docker Compose
4. Kubernetes (AKS)
Configuration Details
Application Map: Automatic service topology Live Metrics: Real-time monitoring Smart Detection: Anomaly detection enabledVerification
Access Azure Portal:- Logs: https://portal.azure.com → Application Insights → Logs
- Application Map: https://portal.azure.com → Application Insights → Application Map
- Live Metrics: https://portal.azure.com → Application Insights → Live Metrics
Elasticsearch
Overview
Export logs and traces to Elasticsearch with daily index rotation and Kibana visualization.Prerequisites
- Elasticsearch cluster (self-hosted or Elastic Cloud)
- Kibana for visualization
Setup
1. Configure Environment
2. Docker Compose
3. Index Patterns
Logs are stored in daily indices:- Logs:
mcp-server-langgraph-logs-2025.10.15 - Traces:
mcp-server-langgraph-traces-2025.10.15
Configuration Details
Index Lifecycle Management: Configure retention policies Mapping: Elastic Common Schema (ECS) Compression: gzip enabled Flush Interval: 30s, 5MBVerification
Datadog
Overview
Unified observability with APM, Log Management, and Infrastructure monitoring.Prerequisites
- Datadog account
- API key from https://app.datadoghq.com/organization-settings/api-keys
Setup
1. Configure Environment
2. Docker Compose
3. Kubernetes
Configuration Details
Service Map: Automatic distributed tracing Watchdog: Anomaly detection enabled Host Metadata: Auto-tagged with environment, service, versionVerification
Access Datadog:- Logs: https://app.datadoghq.com/logs
- APM: https://app.datadoghq.com/apm/home
- Infrastructure: https://app.datadoghq.com/infrastructure
Splunk
Overview
Export logs to Splunk Enterprise (via HEC) or Splunk Observability Cloud (via SAPM/SignalFx).Prerequisites
- Splunk Enterprise or Splunk Observability Cloud account
- HEC token created
Setup (Splunk Enterprise)
1. Create HEC Token
In Splunk Web:- Settings → Data Inputs → HTTP Event Collector
- Click “New Token”
- Name:
mcp-server-langgraph - Source type:
_json - Index:
main - Save and copy token
2. Configure Environment
3. Docker Compose
Setup (Splunk Observability Cloud)
Configuration Details
HEC Endpoint:${SPLUNK_HEC_ENDPOINT}/services/collector
Source: mcp-server-langgraph
Sourcetype: _json (logs), metric (metrics)
Compression: gzip enabled
Verification
Access Splunk and run:Platform Comparison
| Feature | AWS | GCP | Azure | Elasticsearch | Datadog | Splunk |
|---|---|---|---|---|---|---|
| Unified Exporter | ❌ (3 separate) | ✅ | ✅ | ❌ (2 separate) | ✅ | ❌ (2 modes) |
| Auto Trace Correlation | ✅ | ✅ | ✅ | ⚠️ (manual) | ✅ | ⚠️ (manual) |
| Service Map | ✅ (X-Ray) | ✅ (Trace) | ✅ (App Map) | ❌ | ✅ | ✅ (APM) |
| Anomaly Detection | ⚠️ (CloudWatch Anomaly) | ✅ (ML) | ✅ (Smart Detection) | ✅ (ML) | ✅ (Watchdog) | ✅ (ITSI) |
| Retention | Configurable | 30 days default | 90 days default | Configurable | 15 days (standard) | Configurable |
| Query Language | CloudWatch Insights | Log Explorer | KQL | Elasticsearch DSL | Datadog Query | SPL |
| Cost | Pay per GB | Pay per GB | Pay per GB | Self-hosted or Cloud | Per host | License or Cloud |
Troubleshooting
Logs Not Appearing
Check OTLP collector status:Authentication Failures
AWS: Verify IAM permissions GCP: Check service account roles Azure: Validate connection string Datadog: Confirm API key is valid Elasticsearch: Test basic auth credentials Splunk: Verify HEC tokenHigh Cardinality
Reduce log volume:Best Practices
1. Use Structured Fields
2. Include Trace Context
Trace context is automatically injected. Ensure OpenTelemetry tracing is enabled:3. Set Appropriate Log Levels
- DEBUG: Development only
- INFO: General events (default)
- WARNING: Potential issues
- ERROR: Errors that need attention
- CRITICAL: System failures
4. Configure Retention
Set retention policies based on compliance requirements:- Audit logs: 7 years
- Application logs: 30-90 days
- Debug logs: 7 days
5. Monitor Costs
- AWS CloudWatch: ~$0.50/GB ingested
- GCP Cloud Logging: ~$0.50/GB ingested
- Azure Monitor: ~$2.76/GB ingested
- Datadog: Per host pricing
- Elasticsearch: Infrastructure costs
- Splunk: Per GB ingested
Next Steps
- Log Query Examples - Platform-specific query examples
- Observability Guide - Complete observability setup
- Kubernetes Deployment - Production Kubernetes deployment