

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 10
click for more info
Not enough gems
Cost: 6 gems
1: Logging Context
incomplete
2: Build Information
incomplete
3: Instance Context
incomplete
4: Request Context
incomplete
5: User Context
incomplete
6: HTTP Error Responses
incomplete
7: Inter-Process Context
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
It's important to pass logging context between parts of one app, but we also need to pass context between processes and services over the network.
In a microservices architecture, you'll usually propagate a request ID across services so related logs can be correlated.
2023/10/01 12:34:57 severity="INFO" message="Authentication succeeded" service="auth" user="alice" request_id="ibaev4EiyaiS1Kot"
2023/10/01 12:34:57 severity="INFO" message="request served" service="api" request_id="ibaev4EiyaiS1Kot"
For HTTP services, the easiest way to propagate this ID is with a header like X-Request-ID.
Propagate request IDs through headers and logs.
Including the request ID in the response header makes debugging easier – clients can report the ID, and you can search your logs for it.
Restart your server with LINKO_LOG_FILE=linko.access.log set:
LINKO_LOG_FILE=linko.access.log go run .
Run and submit the CLI tests from the root of the Linko repo.