liveBook · Manning

Log backend

As explained in gRPC Microservices in Go

A logging backend is a system that receives, stores, analyzes, or presents logs collected from applications and infrastructure.

A logging backend centralizes application and infrastructure logs so operators can search events, analyze failures, build dashboards, and create alarms. This becomes essential when independent gRPC microservices produce separate log streams that are difficult to combine locally. section 9.1.3 section 9.3.7

Choose the collection path according to deployment constraints:

  • Use node-level logging when applications write to files or standard output; rotate growing files, then ship or analyze the resulting files centrally. section 9.1.3
  • Use cluster-level logging when Kubernetes nodes run collection agents, typically as a DaemonSet, to gather container standard-output logs and forward them centrally. section 9.1.3
  • Treat the backend as more than a request receiver: it may also provide log dashboards and alarms. section 9.1.3
  • Add correlation or distributed trace IDs when operators need to filter one operation across services. section 9.3.7

Trace-aware application logs

A Go service can use logrus with a JSON formatter that reads span data from context and adds trace_id and span_id to every entry. Calling log.WithContext(ctx).Info("Creating order...") then produces searchable structured output for a distributed operation. section 9.3.7

Figure 9.6 Node-level logging architecture

Compare node-level file or standard-output logging with rotation and later shipping. section 9.1.3

Figure 9.7 Cluster-level logging architecture

Follow the Kubernetes cluster-level path from container output through node agents to centralized collection. section 9.1.3

How gRPC Microservices in Go covers it

How deep it goes
Explains node-level and cluster-level architectures, then demonstrates trace-aware Go logging without detailing backend deployment.
Examples
Uses node rotation, Kubernetes DaemonSets, ELK components, logrus fields, and trace-aware JSON output.
What it assumes
Assumes familiarity with application logs and distributed services while defining node-level and cluster-level collection architectures.
What you can do after
Operate/configure structured Go logging that preserves trace context for centralized cross-service filtering.
How it connects
Connects logging backends with Kubernetes, gRPC microservices, OpenTelemetry, log collectors, and distributed tracing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of gRPC Microservices in Go. The section links point to the parts of the book it draws on.