Structured Logging with slog #79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tasks
fmt.Println,fmt.Printf,log.Printfusages withlog/slog(Go standard library, 1.21+)main.go:ENV=development):slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug})ENV=production):slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelInfo})slog.SetDefault(logger)request_id,method,path,status,duration_msrun_id,job_id,statususer_id,actionslogAcceptance Criteria
slog— no rawfmt.Printlnremainingrun_idandjob_idpresent in all run-related log entries