Skip to content

Use structured logging for MTC components - #9152

Open
aarongable wants to merge 4 commits into
mainfrom
slog-mtc
Open

aarongable wants to merge 4 commits into
mainfrom
slog-mtc

Conversation

@aarongable

@aarongable aarongable commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Reland the blog package, which has all of the scaffolding and infrastructure for outputting structured logs. This is a partial reland of PR #8606, which was merged as commit abfceb5. It is therefore also a partial revert of PR #8853, which was merged as commit 4f9cc84.

Add a stub to cmd/shell.go which creates a structured logger. This stub will eventually grow to replace the existing cmd.NewLogger, when we're ready to use structured logging for all shared tasks (cmd.AuditPanic, the mysql logger, etc).

Plumb the new structured logger through the MTCA, MTCB, and MTPublisher packages, and update their logging calls to take advantage of it.

Part of #8557
Fixes #9149


Note

For reviewers, the first commit is pulled directly from #8854 with no changes. The second and third commits build on that to use slog within the MTC packages.

Example logs:

nhapHQ [AUDIT] {"time":"2026-11-04T02:19:44.114318903Z","level":"INFO","msg":"Issuing","mtclogid":"44947.4.1.0.44","entryIndex":3,"newRootHash":"9Z9zNPNtOA4AClLf61GxfzOCWCzOVhVA/BX2UG5xZIM=","TBSCertificateLogEntry":"a00302010230153113301106082b060105050719030d0582df130401301e170d3236313130343031323131345a170d3236313131303137323131335a3000301306072a8648ce3d020106082a8648ce3d0301070420905b8f297ca3371271601d0b581674ba9551e81d601d0b4d9384dfeae340e681a381ea3081e7300e0603551d0f0101ff04040302078030130603551d25040c300a06082b06010505070301300c0603551d130101ff0402300030100603551d2304093007800582df130401303a06082b06010505070101042e302c302a06082b06010505073002861e687474703a2f2f69676e6f7265642e6c657473656e63727970742e6f726730180603551d110101ff040e300c820a3961353765662e636f6d30130603551d20040c300a3008060667810c01020130350603551d1f042e302c302aa028a0268624687474703a2f2f69676e6f7265642e6c657473656e63727970742e6f72672f372e63726c"}
2026-11-04T02:19:44.171916+00:00Z 1b418d750ea0 unknown boulder-ra[868]: 6 boulder-ra YA_GpQ issued MTC from 44947.4.1.0.44: 12384898975268867
2026-11-04T02:19:44.172567+00:00Z 1b418d750ea0 unknown boulder-wfe2[910]: 6 boulder-wfe2 GSHhLg POST /acme/finalize/ 327 200 161 0.0.0.0 JSON={"Slug":"327/295","ua":"eggsampler-acme/v3 Go-http-client/1.1","Extra":{"KeyType":"ECDSA P-256"},"Identifiers":[{"type":"dns","value":"9a57ef.com"}]}
XHUWxQ {"time":"2026-11-04T02:19:44.515345123Z","level":"INFO","msg":"Published checkpoint to mirror","mtclogid":"44947.4.1.0.44","mirrorid":"32473.9","id":4,"treesize":4}
qztN9Q {"time":"2026-11-04T02:19:44.522073683Z","level":"INFO","msg":"Stored checkpoint cosignature from mirror","mtclogid":"44947.4.1.0.44","mirrorid":"32473.9","id":4,"treesize":4}
J0yIYQ {"time":"2026-11-04T02:19:45.467989178Z","level":"INFO","msg":"Stored mirror signature for subtree","mtclogid":"44947.4.1.0.44","mirrorid":"32473.9","subtree":{"id":3,"start":0,"end":4}}
2026-11-04T02:19:47.186048+00:00Z 1b418d750ea0 unknown boulder-wfe2[910]: 6 boulder-wfe2 1AqyRA POST-as-GET /acme/order/ 327 200 10 0.0.0.0 JSON={"Slug":"327/295","ua":"eggsampler-acme/v3 Go-http-client/1.1"}
9lCDVw {"time":"2026-11-04T02:19:47.201317014Z","level":"INFO","msg":"Built standalone","mtclogid":"44947.4.1.0.44","serial":"2c000000000003","prooflen":2}
2026-11-04T02:19:47.201842+00:00Z 1b418d750ea0 unknown boulder-wfe2[910]: 6 boulder-wfe2 EaY9cA POST-as-GET /acme/mtc/ 327 200 14 0.0.0.0 JSON={"Slug":"327/295/44947.4.1.0.44/12384898975268867","ua":"eggsampler-acme/v3 Go-http-client/1.1","Extra":{"RequestedMtcSerial":12384898975268867}}

@aarongable
aarongable requested a review from a team as a code owner November 4, 2026 02:26
@aarongable
aarongable requested a review from ezekiel November 4, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use slog for logging from MTC packages

1 participant