GrabAditya PraharajProblem & solution
Structured Logging: The Best Friend You’ll Want When Things Go Wrong
Summary
Grab redesigned its backend logging approach to address mounting vendor costs, query language limitations, and debugging difficulties across a growing microservices ecosystem. Most services previously emitted syslog-style key-value logs almost entirely at the INFO level, which made volume reduction difficult and lacked causal ordering and automated correlation. The engineering team migrated to a self-managed Elastic stack backend and built a structured logging library in Go from the ground up. This framework introduces dynamic log-level adjustment at runtime, automatic trace-based log correlation via Grab-Kit, and the Common Grab Log Schema to enforce consistent JSON formatting without Elasticsearch indexing conflicts.
Context
Rapid growth of backend services at Grab led to high logging vendor costs, limited query capabilities, pervasive use of only the INFO log level, and issues with causal ordering and cross-service log correlation.
Approach / What changed
Grab built a custom Go logging library integrated with a self-managed Elastic stack, featuring dynamic runtime log levels, automated trace ID correlation, and the Common Grab Log Schema (CGLS) for deterministic JSON field typing.
Takeaways
Recording log write times instead of generation times jumbles the order of events emitted within microseconds, breaking causal ordering.
Emitting conflicting data types under the same JSON field name triggers indexing failures in Elasticsearch mappings.
Dynamic log levels controlled via configuration management allow systems to run at WARN or INFO in production and switch to DEBUG during incidents without redeploying.
Source and freshness
- Source
- engineering.grab.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.