Prompt
need centralized application logs search across microservices
Latest observation
Oct 28, 2026
OpenAI APIWeb search: off
A good way to get centralized application log search across microservices is to use a log aggregation stack with a single searchable backend.
Recommended approach
1) Collect logs from every service
Each microservice should write logs to stdout/stderr or a local log file in structured JSON format.
2) Ship logs to a central system
Use an agent/collector on each node or cluster to forward logs to a central store.
Common options:
- Fluent Bit or Fluentd
- Filebeat or Vector
- OpenTelemetry Collector for logs
3) Store logs in a searchable backend
Popular choices:
- OpenSearch / Elasticsearch for rich search and filtering
- Grafana Loki for cost-effective log search and integration with Grafana
- Graylog if you want a turnkey log management platform
- Splunk if you want enterprise/commercial features
4) Add correlation fields
To search effectively across microservices, include these fields in every log:
service_nameenvironmenttrace_idspan_idrequest_idpod/container/hosttimestamplog_level
This lets you search by:
- a single request across many services
- a particular user action
- one error propagating through the system
Best practice architecture
For Kubernetes or containerized microservices:
Apps → stdout JSON logs → Fluent Bit / Vector → Loki or OpenSearch → Grafana / Kibana
If you want simple and scalable
Option A: Grafana Loki
Best if you want:
- lower cost
- easy Kubernetes integration
- good enough search for most operational needs
Option B: OpenSearch / Elasticsearch
Best if you want:
- advanced full-text search
- complex queries
- heavier analytics on logs
What to avoid
- Logging only plain text without structure
- Storing logs separately in each service
- Missing correlation IDs
- Relying on local disk logs only
- No retention policy
Minimal implementation example
A log line should look like this:
{
"timestamp": "2026-10-28T10:15:30Z",
"level": "ERROR",
"service_name": "payment-service",
"trace_id": "abc123",
"request_id": "req-789",
"message": "Payment authorization failed",
"user_id": "u456"
}
Then you can search:
service_name="payment-service" AND level="ERROR"trace_id="abc123"message contains "failed"
My recommendation
If you’re on Kubernetes:
- Fluent Bit + Loki + Grafana If you need heavier search and reporting:
- Fluent Bit/Filebeat + OpenSearch + Kibana/OpenSearch Dashboards
If you want, I can also give you:
- a reference architecture
- a Kubernetes setup
- a Docker Compose example
- a comparison of Loki vs Elasticsearch vs Splunk