[{"data":1,"prerenderedAt":1780},["ShallowReactive",2],{"navigation_docs":3,"-standard-library-structured-logging":377,"-standard-library-structured-logging-surround":1775},[4,39,114,144,184,244,293,362],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25,30,35],{"title":11,"path":12,"stem":13,"icon":14},"Learning Path","\u002Fgetting-started\u002Flearning-path","1.getting-started\u002F1.learning-path","i-lucide-map",{"title":16,"path":17,"stem":18,"icon":19},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F2.introduction","i-lucide-house",{"title":21,"path":22,"stem":23,"icon":24},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F3.installation","i-lucide-download",{"title":26,"path":27,"stem":28,"icon":29},"Your First Program","\u002Fgetting-started\u002Ffirst-program","1.getting-started\u002F4.first-program","i-lucide-play",{"title":31,"path":32,"stem":33,"icon":34},"Modules and Dependencies","\u002Fgetting-started\u002Fmodules-and-dependencies","1.getting-started\u002F5.modules-and-dependencies","i-lucide-package-open",{"title":36,"path":37,"stem":38,"icon":34},"Advanced Modules","\u002Fgetting-started\u002Fadvanced-modules","1.getting-started\u002F6.advanced-modules",{"title":40,"path":41,"stem":42,"children":43,"page":6},"Fundamentals","\u002Ffundamentals","2.fundamentals",[44,49,54,59,64,69,74,79,84,89,94,99,104,109],{"title":45,"path":46,"stem":47,"icon":48},"Program Structure","\u002Ffundamentals\u002Fprogram-structure","2.fundamentals\u002F1.program-structure","i-lucide-workflow",{"title":50,"path":51,"stem":52,"icon":53},"Structs and Methods","\u002Ffundamentals\u002Fstructs-and-methods","2.fundamentals\u002F10.structs-and-methods","i-lucide-box",{"title":55,"path":56,"stem":57,"icon":58},"Interfaces","\u002Ffundamentals\u002Finterfaces","2.fundamentals\u002F11.interfaces","i-lucide-plug",{"title":60,"path":61,"stem":62,"icon":63},"Error Handling","\u002Ffundamentals\u002Ferrors","2.fundamentals\u002F12.errors","i-lucide-triangle-alert",{"title":65,"path":66,"stem":67,"icon":68},"Defined Types and Type Aliases","\u002Ffundamentals\u002Fdefined-types","2.fundamentals\u002F13.defined-types","i-lucide-tags",{"title":70,"path":71,"stem":72,"icon":73},"Generics","\u002Ffundamentals\u002Fgenerics","2.fundamentals\u002F14.generics","i-lucide-blocks",{"title":75,"path":76,"stem":77,"icon":78},"Project Structure","\u002Ffundamentals\u002Fproject-structure","2.fundamentals\u002F2.project-structure","i-lucide-folder-tree",{"title":80,"path":81,"stem":82,"icon":83},"Project Layout","\u002Ffundamentals\u002Fproject-layout","2.fundamentals\u002F3.project-layout","i-lucide-layout",{"title":85,"path":86,"stem":87,"icon":88},"Variables and Data Types","\u002Ffundamentals\u002Fvariables-and-types","2.fundamentals\u002F4.variables-and-types","i-lucide-variable",{"title":90,"path":91,"stem":92,"icon":93},"Functions","\u002Ffundamentals\u002Ffunctions","2.fundamentals\u002F5.functions","i-lucide-braces",{"title":95,"path":96,"stem":97,"icon":98},"Control Statements","\u002Ffundamentals\u002Fcontrol-statements","2.fundamentals\u002F6.control-statements","i-lucide-git-branch",{"title":100,"path":101,"stem":102,"icon":103},"Pointers","\u002Ffundamentals\u002Fpointers","2.fundamentals\u002F7.pointers","i-lucide-mouse-pointer-2",{"title":105,"path":106,"stem":107,"icon":108},"Arrays and Slices","\u002Ffundamentals\u002Farrays-and-slices","2.fundamentals\u002F8.arrays-and-slices","i-lucide-list",{"title":110,"path":111,"stem":112,"icon":113},"Maps","\u002Ffundamentals\u002Fmaps","2.fundamentals\u002F9.maps","i-lucide-table-properties",{"title":115,"path":116,"stem":117,"children":118,"page":6},"Concurrency","\u002Fconcurrency","3.concurrency",[119,124,129,134,139],{"title":120,"path":121,"stem":122,"icon":123},"Concurrency Model","\u002Fconcurrency\u002Fconcurrency-model","3.concurrency\u002F1.concurrency-model","i-lucide-network",{"title":125,"path":126,"stem":127,"icon":128},"Goroutines","\u002Fconcurrency\u002Fgoroutines","3.concurrency\u002F2.goroutines","i-lucide-git-fork",{"title":130,"path":131,"stem":132,"icon":133},"Channels","\u002Fconcurrency\u002Fchannels","3.concurrency\u002F3.channels","i-lucide-arrow-left-right",{"title":135,"path":136,"stem":137,"icon":138},"Select and Cancellation","\u002Fconcurrency\u002Fselect-and-cancellation","3.concurrency\u002F4.select-and-cancellation","i-lucide-circle-stop",{"title":140,"path":141,"stem":142,"icon":143},"Synchronization","\u002Fconcurrency\u002Fsynchronization","3.concurrency\u002F5.synchronization","i-lucide-lock-keyhole",{"title":145,"path":146,"stem":147,"children":148,"page":6},"Standard Library","\u002Fstandard-library","4.standard-library",[149,154,159,164,169,174,179],{"title":150,"path":151,"stem":152,"icon":153},"Standard Library Overview","\u002Fstandard-library\u002Foverview","4.standard-library\u002F1.overview","i-lucide-library",{"title":155,"path":156,"stem":157,"icon":158},"Text and Formatting","\u002Fstandard-library\u002Ftext-and-formatting","4.standard-library\u002F2.text-and-formatting","i-lucide-text",{"title":160,"path":161,"stem":162,"icon":163},"Files and JSON","\u002Fstandard-library\u002Ffiles-and-json","4.standard-library\u002F3.files-and-json","i-lucide-file-json",{"title":165,"path":166,"stem":167,"icon":168},"HTTP Clients and Servers","\u002Fstandard-library\u002Fhttp","4.standard-library\u002F4.http","i-lucide-server",{"title":170,"path":171,"stem":172,"icon":173},"Testing","\u002Fstandard-library\u002Ftesting","4.standard-library\u002F5.testing","i-lucide-flask-conical",{"title":175,"path":176,"stem":177,"icon":178},"Command-Line Tools and Configuration","\u002Fstandard-library\u002Fcommand-line-and-configuration","4.standard-library\u002F6.command-line-and-configuration","i-lucide-terminal-square",{"title":180,"path":181,"stem":182,"icon":183},"Structured Logging","\u002Fstandard-library\u002Fstructured-logging","4.standard-library\u002F7.structured-logging","i-lucide-scroll-text",{"title":185,"path":186,"stem":187,"children":188,"page":6},"Backend Development","\u002Fbackend-development","5.backend-development",[189,194,199,204,209,214,219,224,229,234,239],{"title":190,"path":191,"stem":192,"icon":193},"Backend Roadmap","\u002Fbackend-development\u002Fbackend-roadmap","5.backend-development\u002F1.backend-roadmap","i-lucide-route",{"title":195,"path":196,"stem":197,"icon":198},"Graceful Shutdown","\u002Fbackend-development\u002Fgraceful-shutdown","5.backend-development\u002F10.graceful-shutdown","i-lucide-power",{"title":200,"path":201,"stem":202,"icon":203},"Production Checklist","\u002Fbackend-development\u002Fproduction-checklist","5.backend-development\u002F11.production-checklist","i-lucide-clipboard-check",{"title":205,"path":206,"stem":207,"icon":208},"HTTP API Design","\u002Fbackend-development\u002Fhttp-api-design","5.backend-development\u002F2.http-api-design","i-lucide-waypoints",{"title":210,"path":211,"stem":212,"icon":213},"Middleware","\u002Fbackend-development\u002Fmiddleware","5.backend-development\u002F3.middleware","i-lucide-layers-3",{"title":215,"path":216,"stem":217,"icon":218},"Validation","\u002Fbackend-development\u002Fvalidation","5.backend-development\u002F4.validation","i-lucide-list-checks",{"title":220,"path":221,"stem":222,"icon":223},"Application Wiring","\u002Fbackend-development\u002Fapplication-wiring","5.backend-development\u002F5.application-wiring","i-lucide-cable",{"title":225,"path":226,"stem":227,"icon":228},"Observability","\u002Fbackend-development\u002Fobservability","5.backend-development\u002F6.observability","i-lucide-activity",{"title":230,"path":231,"stem":232,"icon":233},"Database SQL","\u002Fbackend-development\u002Fdatabase-sql","5.backend-development\u002F7.database-sql","i-lucide-database",{"title":235,"path":236,"stem":237,"icon":238},"Transactions","\u002Fbackend-development\u002Ftransactions","5.backend-development\u002F8.transactions","i-lucide-repeat-2",{"title":240,"path":241,"stem":242,"icon":243},"Authentication and Authorization","\u002Fbackend-development\u002Fauthentication","5.backend-development\u002F9.authentication","i-lucide-shield-check",{"title":245,"path":246,"stem":247,"children":248,"page":6},"Advanced Go","\u002Fadvanced-go","6.advanced-go",[249,254,259,264,269,274,278,283,288],{"title":250,"path":251,"stem":252,"icon":253},"Advanced Go Roadmap","\u002Fadvanced-go\u002Fadvanced-roadmap","6.advanced-go\u002F1.advanced-roadmap","i-lucide-brain-circuit",{"title":255,"path":256,"stem":257,"icon":258},"Reflection","\u002Fadvanced-go\u002Freflection","6.advanced-go\u002F2.reflection","i-lucide-scan-search",{"title":260,"path":261,"stem":262,"icon":263},"Memory and Garbage Collection","\u002Fadvanced-go\u002Fmemory-and-garbage-collection","6.advanced-go\u002F3.memory-and-garbage-collection","i-lucide-memory-stick",{"title":265,"path":266,"stem":267,"icon":268},"Benchmarking and Profiling","\u002Fadvanced-go\u002Fbenchmarking-and-profiling","6.advanced-go\u002F4.benchmarking-and-profiling","i-lucide-gauge",{"title":270,"path":271,"stem":272,"icon":273},"Advanced Testing and Fuzzing","\u002Fadvanced-go\u002Fadvanced-testing-and-fuzzing","6.advanced-go\u002F5.advanced-testing-and-fuzzing","i-lucide-microscope",{"title":275,"path":276,"stem":277,"icon":48},"Advanced Concurrency","\u002Fadvanced-go\u002Fadvanced-concurrency","6.advanced-go\u002F6.advanced-concurrency",{"title":279,"path":280,"stem":281,"icon":282},"Unsafe and C Boundaries","\u002Fadvanced-go\u002Funsafe-and-cgo","6.advanced-go\u002F7.unsafe-and-cgo","i-lucide-radiation",{"title":284,"path":285,"stem":286,"icon":287},"Package and API Design","\u002Fadvanced-go\u002Fpackage-and-api-design","6.advanced-go\u002F8.package-and-api-design","i-lucide-boxes",{"title":289,"path":290,"stem":291,"icon":292},"Distributed Reliability","\u002Fadvanced-go\u002Fdistributed-reliability","6.advanced-go\u002F9.distributed-reliability","i-lucide-cloud-cog",{"title":294,"path":295,"stem":296,"children":297,"page":6},"Projects","\u002Fprojects","7.projects",[298,316,332,347],{"title":299,"path":300,"stem":301,"children":302,"icon":305},"CLI Task Manager","\u002Fprojects\u002Fcli-task-manager","7.projects\u002F1.cli-task-manager\u002Findex",[303,306,311],{"title":304,"path":300,"stem":301,"icon":305},"Project — CLI Task Manager","i-lucide-list-todo",{"title":307,"path":308,"stem":309,"icon":310},"CLI — Domain and Storage","\u002Fprojects\u002Fcli-task-manager\u002Fdomain-and-storage","7.projects\u002F1.cli-task-manager\u002F1.domain-and-storage","i-lucide-save",{"title":312,"path":313,"stem":314,"icon":315},"CLI — Commands and Tests","\u002Fprojects\u002Fcli-task-manager\u002Fcommands-and-tests","7.projects\u002F1.cli-task-manager\u002F2.commands-and-tests","i-lucide-terminal",{"title":317,"path":318,"stem":319,"children":320,"icon":323},"Concurrent URL Checker","\u002Fprojects\u002Fconcurrent-url-checker","7.projects\u002F2.concurrent-url-checker\u002Findex",[321,324,328],{"title":322,"path":318,"stem":319,"icon":323},"Project — Concurrent URL Checker","i-lucide-radar",{"title":325,"path":326,"stem":327,"icon":128},"URL Checker — Worker Pipeline","\u002Fprojects\u002Fconcurrent-url-checker\u002Fworker-pipeline","7.projects\u002F2.concurrent-url-checker\u002F1.worker-pipeline",{"title":329,"path":330,"stem":331,"icon":173},"URL Checker — Cancellation and Tests","\u002Fprojects\u002Fconcurrent-url-checker\u002Fcancellation-and-tests","7.projects\u002F2.concurrent-url-checker\u002F2.cancellation-and-tests",{"title":333,"path":334,"stem":335,"children":336},"File-backed API","\u002Fprojects\u002Ffile-backed-api","7.projects\u002F3.file-backed-api\u002Findex",[337,339,343],{"title":338,"path":334,"stem":335},"File-backed notes API",{"title":340,"path":341,"stem":342},"File store and concurrency","\u002Fprojects\u002Ffile-backed-api\u002Ffile-store-and-concurrency","7.projects\u002F3.file-backed-api\u002F1.file-store-and-concurrency",{"title":344,"path":345,"stem":346},"HTTP layer and tests","\u002Fprojects\u002Ffile-backed-api\u002Fhttp-and-tests","7.projects\u002F3.file-backed-api\u002F2.http-and-tests",{"title":348,"path":349,"stem":350,"children":351},"Production REST API","\u002Fprojects\u002Fproduction-rest-api","7.projects\u002F4.production-rest-api\u002Findex",[352,354,358],{"title":353,"path":349,"stem":350},"Production REST API capstone",{"title":355,"path":356,"stem":357},"Persistence and authentication","\u002Fprojects\u002Fproduction-rest-api\u002Fpersistence-and-auth","7.projects\u002F4.production-rest-api\u002F1.persistence-and-auth",{"title":359,"path":360,"stem":361},"Operations and release","\u002Fprojects\u002Fproduction-rest-api\u002Foperations-and-release","7.projects\u002F4.production-rest-api\u002F2.operations-and-release",{"title":363,"path":364,"stem":365,"children":366,"page":6},"Meta","\u002Fmeta","99.meta",[367,372],{"title":368,"path":369,"stem":370,"icon":371},"About","\u002Fmeta\u002Fabout","99.meta\u002F1.about","i-lucide-info",{"title":373,"path":374,"stem":375,"icon":376},"Acknowledgements","\u002Fmeta\u002Facknowledgements","99.meta\u002F2.acknowledgements","i-lucide-heart-handshake",{"id":378,"title":180,"body":379,"description":1767,"extension":1768,"links":1769,"meta":1770,"navigation":1771,"path":181,"seo":1772,"stem":182,"__hash__":1774},"docs\u002F4.standard-library\u002F7.structured-logging.md",{"type":380,"value":381,"toc":1754},"minimark",[382,388,393,397,421,425,428,431,507,510,601,605,843,846,850,875,878,882,1021,1027,1034,1129,1132,1136,1139,1187,1190,1239,1242,1246,1249,1269,1272,1276,1282,1285,1289,1325,1329,1332,1712,1716,1733,1743,1746,1750],[383,384],"learning-lesson-meta",{"level":385,"prerequisites":386,"time":387},"Intermediate","Errors, context, configuration, and interfaces","35–45 minutes",[389,390,392],"h2",{"id":391},"what-you-will-learn","What you will learn",[394,395,396],"p",{},"By the end of this lesson, you will be able to:",[398,399,400,409,412,415,418],"ul",{},[401,402,403,404,408],"li",{},"configure text and JSON ",[405,406,407],"code",{},"slog"," handlers;",[401,410,411],{},"use stable attributes instead of building messages with string concatenation;",[401,413,414],{},"choose useful log levels;",[401,416,417],{},"add request-scoped attributes without storing a logger implicitly in context;",[401,419,420],{},"avoid duplicated errors and sensitive-data leaks.",[389,422,424],{"id":423},"mental-model-logs-are-events","Mental model: logs are events",[394,426,427],{},"A human sentence is useful while reading one line. Structured attributes make millions of lines searchable and aggregatable.",[394,429,430],{},"Instead of this:",[432,433,438],"pre",{"className":434,"code":435,"language":436,"meta":437,"style":437},"language-go shiki shiki-themes solarized-light material-theme one-dark-pro","log.Printf(\"user %s completed lesson %s in %dms\", userID, lessonID, elapsed)\n","go","",[405,439,440],{"__ignoreMap":437},[441,442,445,449,453,457,460,464,468,472,475,477,480,483,486,488,491,494,496,499,501,504],"span",{"class":443,"line":444},"line",1,[441,446,448],{"class":447},"s45-6","log",[441,450,452],{"class":451},"shFME",".",[441,454,456],{"class":455},"sisdC","Printf",[441,458,459],{"class":451},"(",[441,461,463],{"class":462},"sED5a","\"",[441,465,467],{"class":466},"sVazx","user ",[441,469,471],{"class":470},"st3jj","%s",[441,473,474],{"class":466}," completed lesson ",[441,476,471],{"class":470},[441,478,479],{"class":466}," in ",[441,481,482],{"class":470},"%d",[441,484,485],{"class":466},"ms",[441,487,463],{"class":462},[441,489,490],{"class":451},",",[441,492,493],{"class":447}," userID",[441,495,490],{"class":451},[441,497,498],{"class":447}," lessonID",[441,500,490],{"class":451},[441,502,503],{"class":447}," elapsed",[441,505,506],{"class":451},")\n",[394,508,509],{},"record a stable event with fields:",[432,511,513],{"className":434,"code":512,"language":436,"meta":437,"style":437},"logger.Info(\n    \"lesson completed\",\n    \"user_id\", userID,\n    \"lesson_id\", lessonID,\n    \"duration_ms\", elapsed.Milliseconds(),\n)\n",[405,514,515,528,542,558,574,596],{"__ignoreMap":437},[441,516,517,520,522,525],{"class":443,"line":444},[441,518,519],{"class":447},"logger",[441,521,452],{"class":451},[441,523,524],{"class":455},"Info",[441,526,527],{"class":451},"(\n",[441,529,531,534,537,539],{"class":443,"line":530},2,[441,532,533],{"class":462},"    \"",[441,535,536],{"class":466},"lesson completed",[441,538,463],{"class":462},[441,540,541],{"class":451},",\n",[441,543,545,547,550,552,554,556],{"class":443,"line":544},3,[441,546,533],{"class":462},[441,548,549],{"class":466},"user_id",[441,551,463],{"class":462},[441,553,490],{"class":451},[441,555,493],{"class":447},[441,557,541],{"class":451},[441,559,561,563,566,568,570,572],{"class":443,"line":560},4,[441,562,533],{"class":462},[441,564,565],{"class":466},"lesson_id",[441,567,463],{"class":462},[441,569,490],{"class":451},[441,571,498],{"class":447},[441,573,541],{"class":451},[441,575,577,579,582,584,586,588,590,593],{"class":443,"line":576},5,[441,578,533],{"class":462},[441,580,581],{"class":466},"duration_ms",[441,583,463],{"class":462},[441,585,490],{"class":451},[441,587,503],{"class":447},[441,589,452],{"class":451},[441,591,592],{"class":455},"Milliseconds",[441,594,595],{"class":451},"(),\n",[441,597,599],{"class":443,"line":598},6,[441,600,506],{"class":451},[389,602,604],{"id":603},"configure-a-logger-once","Configure a logger once",[432,606,608],{"className":434,"code":607,"language":436,"meta":437,"style":437},"func newLogger(environment string, level slog.Leveler) *slog.Logger {\n    options := &slog.HandlerOptions{Level: level}\n\n    var handler slog.Handler\n    if environment == \"production\" {\n        handler = slog.NewJSONHandler(os.Stdout, options)\n    } else {\n        handler = slog.NewTextHandler(os.Stdout, options)\n    }\n\n    return slog.New(handler)\n}\n",[405,609,610,659,692,698,713,736,768,779,807,813,818,838],{"__ignoreMap":437},[441,611,612,616,619,621,625,629,631,634,638,640,643,646,649,651,653,656],{"class":443,"line":444},[441,613,615],{"class":614},"sEOdo","func",[441,617,618],{"class":455}," newLogger",[441,620,459],{"class":451},[441,622,624],{"class":623},"syre3","environment",[441,626,628],{"class":627},"sF6sA"," string",[441,630,490],{"class":451},[441,632,633],{"class":623}," level",[441,635,637],{"class":636},"snwKR"," slog",[441,639,452],{"class":451},[441,641,642],{"class":636},"Leveler",[441,644,645],{"class":451},")",[441,647,648],{"class":614}," *",[441,650,407],{"class":636},[441,652,452],{"class":451},[441,654,655],{"class":636},"Logger",[441,657,658],{"class":451}," {\n",[441,660,661,664,668,671,673,675,678,681,684,687,689],{"class":443,"line":530},[441,662,663],{"class":447},"    options",[441,665,667],{"class":666},"su2KV"," :=",[441,669,670],{"class":614}," &",[441,672,407],{"class":636},[441,674,452],{"class":451},[441,676,677],{"class":636},"HandlerOptions",[441,679,680],{"class":451},"{",[441,682,683],{"class":447},"Level",[441,685,686],{"class":451},":",[441,688,633],{"class":447},[441,690,691],{"class":451},"}\n",[441,693,694],{"class":443,"line":544},[441,695,697],{"emptyLinePlaceholder":696},true,"\n",[441,699,700,703,706,708,710],{"class":443,"line":560},[441,701,702],{"class":614},"    var",[441,704,705],{"class":447}," handler",[441,707,637],{"class":636},[441,709,452],{"class":451},[441,711,712],{"class":636},"Handler\n",[441,714,715,719,722,726,729,732,734],{"class":443,"line":576},[441,716,718],{"class":717},"s7Bcg","    if",[441,720,721],{"class":447}," environment",[441,723,725],{"class":724},"sRBoR"," ==",[441,727,728],{"class":462}," \"",[441,730,731],{"class":466},"production",[441,733,463],{"class":462},[441,735,658],{"class":451},[441,737,738,741,744,746,748,751,753,756,758,761,763,766],{"class":443,"line":598},[441,739,740],{"class":447},"        handler",[441,742,743],{"class":666}," =",[441,745,637],{"class":447},[441,747,452],{"class":451},[441,749,750],{"class":455},"NewJSONHandler",[441,752,459],{"class":451},[441,754,755],{"class":447},"os",[441,757,452],{"class":451},[441,759,760],{"class":447},"Stdout",[441,762,490],{"class":451},[441,764,765],{"class":447}," options",[441,767,506],{"class":451},[441,769,771,774,777],{"class":443,"line":770},7,[441,772,773],{"class":451},"    }",[441,775,776],{"class":717}," else",[441,778,658],{"class":451},[441,780,782,784,786,788,790,793,795,797,799,801,803,805],{"class":443,"line":781},8,[441,783,740],{"class":447},[441,785,743],{"class":666},[441,787,637],{"class":447},[441,789,452],{"class":451},[441,791,792],{"class":455},"NewTextHandler",[441,794,459],{"class":451},[441,796,755],{"class":447},[441,798,452],{"class":451},[441,800,760],{"class":447},[441,802,490],{"class":451},[441,804,765],{"class":447},[441,806,506],{"class":451},[441,808,810],{"class":443,"line":809},9,[441,811,812],{"class":451},"    }\n",[441,814,816],{"class":443,"line":815},10,[441,817,697],{"emptyLinePlaceholder":696},[441,819,821,824,826,828,831,833,836],{"class":443,"line":820},11,[441,822,823],{"class":717},"    return",[441,825,637],{"class":447},[441,827,452],{"class":451},[441,829,830],{"class":455},"New",[441,832,459],{"class":451},[441,834,835],{"class":447},"handler",[441,837,506],{"class":451},[441,839,841],{"class":443,"line":840},12,[441,842,691],{"class":451},[394,844,845],{},"Pass the logger explicitly to services that need it. This makes the dependency visible and testable.",[389,847,849],{"id":848},"choose-levels-by-meaning","Choose levels by meaning",[398,851,852,858,863,869],{},[401,853,854,857],{},[405,855,856],{},"Debug",": detailed development diagnostics, normally disabled in production.",[401,859,860,862],{},[405,861,524],{},": meaningful normal events, such as service startup or completed background work.",[401,864,865,868],{},[405,866,867],{},"Warn",": an unexpected condition that was handled but deserves attention.",[401,870,871,874],{},[405,872,873],{},"Error",": an operation failed and could not be completed at that boundary.",[394,876,877],{},"Do not log routine client mistakes as server errors merely because an HTTP response uses a 4xx status.",[389,879,881],{"id":880},"add-shared-attributes","Add shared attributes",[432,883,885],{"className":434,"code":884,"language":436,"meta":437,"style":437},"requestLogger := logger.With(\n    \"request_id\", requestID,\n    \"method\", request.Method,\n    \"path\", request.URL.Path,\n)\n\nrequestLogger.Info(\"request completed\", \"status\", status, \"duration\", duration)\n",[405,886,887,904,920,941,966,970,974],{"__ignoreMap":437},[441,888,889,892,894,897,899,902],{"class":443,"line":444},[441,890,891],{"class":447},"requestLogger",[441,893,667],{"class":666},[441,895,896],{"class":447}," logger",[441,898,452],{"class":451},[441,900,901],{"class":455},"With",[441,903,527],{"class":451},[441,905,906,908,911,913,915,918],{"class":443,"line":530},[441,907,533],{"class":462},[441,909,910],{"class":466},"request_id",[441,912,463],{"class":462},[441,914,490],{"class":451},[441,916,917],{"class":447}," requestID",[441,919,541],{"class":451},[441,921,922,924,927,929,931,934,936,939],{"class":443,"line":544},[441,923,533],{"class":462},[441,925,926],{"class":466},"method",[441,928,463],{"class":462},[441,930,490],{"class":451},[441,932,933],{"class":447}," request",[441,935,452],{"class":451},[441,937,938],{"class":447},"Method",[441,940,541],{"class":451},[441,942,943,945,948,950,952,954,956,959,961,964],{"class":443,"line":560},[441,944,533],{"class":462},[441,946,947],{"class":466},"path",[441,949,463],{"class":462},[441,951,490],{"class":451},[441,953,933],{"class":447},[441,955,452],{"class":451},[441,957,958],{"class":447},"URL",[441,960,452],{"class":451},[441,962,963],{"class":447},"Path",[441,965,541],{"class":451},[441,967,968],{"class":443,"line":576},[441,969,506],{"class":451},[441,971,972],{"class":443,"line":598},[441,973,697],{"emptyLinePlaceholder":696},[441,975,976,978,980,982,984,986,989,991,993,995,998,1000,1002,1005,1007,1009,1012,1014,1016,1019],{"class":443,"line":770},[441,977,891],{"class":447},[441,979,452],{"class":451},[441,981,524],{"class":455},[441,983,459],{"class":451},[441,985,463],{"class":462},[441,987,988],{"class":466},"request completed",[441,990,463],{"class":462},[441,992,490],{"class":451},[441,994,728],{"class":462},[441,996,997],{"class":466},"status",[441,999,463],{"class":462},[441,1001,490],{"class":451},[441,1003,1004],{"class":447}," status",[441,1006,490],{"class":451},[441,1008,728],{"class":462},[441,1010,1011],{"class":466},"duration",[441,1013,463],{"class":462},[441,1015,490],{"class":451},[441,1017,1018],{"class":447}," duration",[441,1020,506],{"class":451},[394,1022,1023,1026],{},[405,1024,1025],{},"Logger.With"," creates a logger that includes those attributes in future records.",[394,1028,1029,1030,1033],{},"Use ",[405,1031,1032],{},"LogAttrs"," and typed attributes in very hot paths or when explicit types improve clarity:",[432,1035,1037],{"className":434,"code":1036,"language":436,"meta":437,"style":437},"logger.LogAttrs(\n    ctx,\n    slog.LevelInfo,\n    \"request completed\",\n    slog.Int(\"status\", status),\n    slog.Duration(\"duration\", duration),\n)\n",[405,1038,1039,1049,1056,1068,1078,1102,1125],{"__ignoreMap":437},[441,1040,1041,1043,1045,1047],{"class":443,"line":444},[441,1042,519],{"class":447},[441,1044,452],{"class":451},[441,1046,1032],{"class":455},[441,1048,527],{"class":451},[441,1050,1051,1054],{"class":443,"line":530},[441,1052,1053],{"class":447},"    ctx",[441,1055,541],{"class":451},[441,1057,1058,1061,1063,1066],{"class":443,"line":544},[441,1059,1060],{"class":447},"    slog",[441,1062,452],{"class":451},[441,1064,1065],{"class":447},"LevelInfo",[441,1067,541],{"class":451},[441,1069,1070,1072,1074,1076],{"class":443,"line":560},[441,1071,533],{"class":462},[441,1073,988],{"class":466},[441,1075,463],{"class":462},[441,1077,541],{"class":451},[441,1079,1080,1082,1084,1087,1089,1091,1093,1095,1097,1099],{"class":443,"line":576},[441,1081,1060],{"class":447},[441,1083,452],{"class":451},[441,1085,1086],{"class":455},"Int",[441,1088,459],{"class":451},[441,1090,463],{"class":462},[441,1092,997],{"class":466},[441,1094,463],{"class":462},[441,1096,490],{"class":451},[441,1098,1004],{"class":447},[441,1100,1101],{"class":451},"),\n",[441,1103,1104,1106,1108,1111,1113,1115,1117,1119,1121,1123],{"class":443,"line":598},[441,1105,1060],{"class":447},[441,1107,452],{"class":451},[441,1109,1110],{"class":455},"Duration",[441,1112,459],{"class":451},[441,1114,463],{"class":462},[441,1116,1011],{"class":466},[441,1118,463],{"class":462},[441,1120,490],{"class":451},[441,1122,1018],{"class":447},[441,1124,1101],{"class":451},[441,1126,1127],{"class":443,"line":770},[441,1128,506],{"class":451},[394,1130,1131],{},"Passing a context allows a handler to extract contextual information; cancelling the context does not cancel the log call.",[389,1133,1135],{"id":1134},"log-an-error-once","Log an error once",[394,1137,1138],{},"Lower layers should usually add context and return an error:",[432,1140,1142],{"className":434,"code":1141,"language":436,"meta":437,"style":437},"return fmt.Errorf(\"load lesson %q: %w\", id, err)\n",[405,1143,1144],{"__ignoreMap":437},[441,1145,1146,1149,1152,1154,1157,1159,1161,1164,1167,1170,1173,1175,1177,1180,1182,1185],{"class":443,"line":444},[441,1147,1148],{"class":717},"return",[441,1150,1151],{"class":447}," fmt",[441,1153,452],{"class":451},[441,1155,1156],{"class":455},"Errorf",[441,1158,459],{"class":451},[441,1160,463],{"class":462},[441,1162,1163],{"class":466},"load lesson ",[441,1165,1166],{"class":470},"%q",[441,1168,1169],{"class":466},": ",[441,1171,1172],{"class":470},"%w",[441,1174,463],{"class":462},[441,1176,490],{"class":451},[441,1178,1179],{"class":447}," id",[441,1181,490],{"class":451},[441,1183,1184],{"class":447}," err",[441,1186,506],{"class":451},[394,1188,1189],{},"Log it at the application boundary that decides the operation has failed:",[432,1191,1193],{"className":434,"code":1192,"language":436,"meta":437,"style":437},"logger.Error(\"request failed\", \"error\", err, \"request_id\", requestID)\n",[405,1194,1195],{"__ignoreMap":437},[441,1196,1197,1199,1201,1203,1205,1207,1210,1212,1214,1216,1219,1221,1223,1225,1227,1229,1231,1233,1235,1237],{"class":443,"line":444},[441,1198,519],{"class":447},[441,1200,452],{"class":451},[441,1202,873],{"class":455},[441,1204,459],{"class":451},[441,1206,463],{"class":462},[441,1208,1209],{"class":466},"request failed",[441,1211,463],{"class":462},[441,1213,490],{"class":451},[441,1215,728],{"class":462},[441,1217,1218],{"class":466},"error",[441,1220,463],{"class":462},[441,1222,490],{"class":451},[441,1224,1184],{"class":447},[441,1226,490],{"class":451},[441,1228,728],{"class":462},[441,1230,910],{"class":466},[441,1232,463],{"class":462},[441,1234,490],{"class":451},[441,1236,917],{"class":447},[441,1238,506],{"class":451},[394,1240,1241],{},"Logging at every layer creates duplicate records for one failure.",[389,1243,1245],{"id":1244},"protect-sensitive-information","Protect sensitive information",[394,1247,1248],{},"Do not log:",[398,1250,1251,1254,1257,1260,1263,1266],{},[401,1252,1253],{},"passwords or password hashes;",[401,1255,1256],{},"access tokens, API keys, or session cookies;",[401,1258,1259],{},"private keys;",[401,1261,1262],{},"full authorization headers;",[401,1264,1265],{},"complete request or response bodies by default;",[401,1267,1268],{},"personal data unless the operational need and retention policy are clear.",[394,1270,1271],{},"Use a safe identifier, classification, or redacted representation instead.",[389,1273,1275],{"id":1274},"test-logging-behaviour","Test logging behaviour",[394,1277,1278,1281],{},[405,1279,1280],{},"testing\u002Fslogtest"," helps verify custom handlers. For application code, a small handler or buffer can capture records so a test can assert important attributes without comparing timestamps or complete formatted lines.",[394,1283,1284],{},"Prefer testing that a security-sensitive value is absent and a stable event attribute is present.",[389,1286,1288],{"id":1287},"common-mistakes","Common mistakes",[398,1290,1291,1298,1307,1313,1319],{},[401,1292,1293,1297],{},[1294,1295,1296],"strong",{},"Using dynamic sentences as event names:"," queries become brittle.",[401,1299,1300,1303,1304,1306],{},[1294,1301,1302],{},"Using inconsistent keys:"," choose conventions such as ",[405,1305,910],{}," and use them everywhere.",[401,1308,1309,1312],{},[1294,1310,1311],{},"Logging before redaction:"," changing output formatting later cannot recover a leaked secret.",[401,1314,1315,1318],{},[1294,1316,1317],{},"Treating logs as control flow:"," return errors or values; do not require callers to parse logs.",[401,1320,1321,1324],{},[1294,1322,1323],{},"Performing expensive work for disabled debug logs:"," use level checks when attribute construction is costly.",[389,1326,1328],{"id":1327},"practice","Practice",[394,1330,1331],{},"Write HTTP logging middleware that records method, path, status, duration, and request ID. It must not log query parameters or request bodies. Make the logger an explicit dependency.",[1333,1334,1335],"accordion",{},[1336,1337,1340,1351,1705],"accordion-item",{"icon":1338,"label":1339},"i-lucide-lightbulb","Show solution outline",[394,1341,1342,1343,1346,1347,1350],{},"Wrap ",[405,1344,1345],{},"http.ResponseWriter"," so the middleware can remember the status passed to ",[405,1348,1349],{},"WriteHeader",". Record the start time, call the next handler, and emit one event afterward:",[432,1352,1354],{"className":434,"code":1353,"language":436,"meta":437,"style":437},"func Logging(logger *slog.Logger, next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        started := time.Now()\n        requestID := r.Header.Get(\"X-Request-ID\")\n        wrapped := &statusWriter{ResponseWriter: w, status: http.StatusOK}\n\n        next.ServeHTTP(wrapped, r)\n\n        logger.InfoContext(r.Context(), \"request completed\",\n            \"request_id\", requestID,\n            \"method\", r.Method,\n            \"path\", r.URL.Path,\n            \"status\", wrapped.status,\n            \"duration\", time.Since(started),\n        )\n    })\n}\n",[405,1355,1356,1398,1444,1462,1492,1528,1532,1553,1557,1588,1603,1621,1643,1663,1688,1694,1700],{"__ignoreMap":437},[441,1357,1358,1360,1363,1365,1367,1369,1371,1373,1375,1377,1380,1383,1385,1388,1390,1392,1394,1396],{"class":443,"line":444},[441,1359,615],{"class":614},[441,1361,1362],{"class":455}," Logging",[441,1364,459],{"class":451},[441,1366,519],{"class":623},[441,1368,648],{"class":614},[441,1370,407],{"class":636},[441,1372,452],{"class":451},[441,1374,655],{"class":636},[441,1376,490],{"class":451},[441,1378,1379],{"class":623}," next",[441,1381,1382],{"class":636}," http",[441,1384,452],{"class":451},[441,1386,1387],{"class":636},"Handler",[441,1389,645],{"class":451},[441,1391,1382],{"class":636},[441,1393,452],{"class":451},[441,1395,1387],{"class":636},[441,1397,658],{"class":451},[441,1399,1400,1402,1404,1406,1409,1411,1413,1415,1418,1420,1422,1425,1427,1430,1432,1435,1437,1440,1442],{"class":443,"line":530},[441,1401,823],{"class":717},[441,1403,1382],{"class":447},[441,1405,452],{"class":451},[441,1407,1408],{"class":455},"HandlerFunc",[441,1410,459],{"class":451},[441,1412,615],{"class":614},[441,1414,459],{"class":451},[441,1416,1417],{"class":623},"w",[441,1419,1382],{"class":636},[441,1421,452],{"class":451},[441,1423,1424],{"class":636},"ResponseWriter",[441,1426,490],{"class":451},[441,1428,1429],{"class":623}," r",[441,1431,648],{"class":614},[441,1433,1434],{"class":636},"http",[441,1436,452],{"class":451},[441,1438,1439],{"class":636},"Request",[441,1441,645],{"class":451},[441,1443,658],{"class":451},[441,1445,1446,1449,1451,1454,1456,1459],{"class":443,"line":544},[441,1447,1448],{"class":447},"        started",[441,1450,667],{"class":666},[441,1452,1453],{"class":447}," time",[441,1455,452],{"class":451},[441,1457,1458],{"class":455},"Now",[441,1460,1461],{"class":451},"()\n",[441,1463,1464,1467,1469,1471,1473,1476,1478,1481,1483,1485,1488,1490],{"class":443,"line":560},[441,1465,1466],{"class":447},"        requestID",[441,1468,667],{"class":666},[441,1470,1429],{"class":447},[441,1472,452],{"class":451},[441,1474,1475],{"class":447},"Header",[441,1477,452],{"class":451},[441,1479,1480],{"class":455},"Get",[441,1482,459],{"class":451},[441,1484,463],{"class":462},[441,1486,1487],{"class":466},"X-Request-ID",[441,1489,463],{"class":462},[441,1491,506],{"class":451},[441,1493,1494,1497,1499,1501,1504,1506,1508,1510,1513,1515,1517,1519,1521,1523,1526],{"class":443,"line":576},[441,1495,1496],{"class":447},"        wrapped",[441,1498,667],{"class":666},[441,1500,670],{"class":614},[441,1502,1503],{"class":636},"statusWriter",[441,1505,680],{"class":451},[441,1507,1424],{"class":447},[441,1509,686],{"class":451},[441,1511,1512],{"class":447}," w",[441,1514,490],{"class":451},[441,1516,1004],{"class":447},[441,1518,686],{"class":451},[441,1520,1382],{"class":447},[441,1522,452],{"class":451},[441,1524,1525],{"class":447},"StatusOK",[441,1527,691],{"class":451},[441,1529,1530],{"class":443,"line":598},[441,1531,697],{"emptyLinePlaceholder":696},[441,1533,1534,1537,1539,1542,1544,1547,1549,1551],{"class":443,"line":770},[441,1535,1536],{"class":447},"        next",[441,1538,452],{"class":451},[441,1540,1541],{"class":455},"ServeHTTP",[441,1543,459],{"class":451},[441,1545,1546],{"class":447},"wrapped",[441,1548,490],{"class":451},[441,1550,1429],{"class":447},[441,1552,506],{"class":451},[441,1554,1555],{"class":443,"line":781},[441,1556,697],{"emptyLinePlaceholder":696},[441,1558,1559,1562,1564,1567,1569,1572,1574,1577,1580,1582,1584,1586],{"class":443,"line":809},[441,1560,1561],{"class":447},"        logger",[441,1563,452],{"class":451},[441,1565,1566],{"class":455},"InfoContext",[441,1568,459],{"class":451},[441,1570,1571],{"class":447},"r",[441,1573,452],{"class":451},[441,1575,1576],{"class":455},"Context",[441,1578,1579],{"class":451},"(),",[441,1581,728],{"class":462},[441,1583,988],{"class":466},[441,1585,463],{"class":462},[441,1587,541],{"class":451},[441,1589,1590,1593,1595,1597,1599,1601],{"class":443,"line":815},[441,1591,1592],{"class":462},"            \"",[441,1594,910],{"class":466},[441,1596,463],{"class":462},[441,1598,490],{"class":451},[441,1600,917],{"class":447},[441,1602,541],{"class":451},[441,1604,1605,1607,1609,1611,1613,1615,1617,1619],{"class":443,"line":820},[441,1606,1592],{"class":462},[441,1608,926],{"class":466},[441,1610,463],{"class":462},[441,1612,490],{"class":451},[441,1614,1429],{"class":447},[441,1616,452],{"class":451},[441,1618,938],{"class":447},[441,1620,541],{"class":451},[441,1622,1623,1625,1627,1629,1631,1633,1635,1637,1639,1641],{"class":443,"line":840},[441,1624,1592],{"class":462},[441,1626,947],{"class":466},[441,1628,463],{"class":462},[441,1630,490],{"class":451},[441,1632,1429],{"class":447},[441,1634,452],{"class":451},[441,1636,958],{"class":447},[441,1638,452],{"class":451},[441,1640,963],{"class":447},[441,1642,541],{"class":451},[441,1644,1646,1648,1650,1652,1654,1657,1659,1661],{"class":443,"line":1645},13,[441,1647,1592],{"class":462},[441,1649,997],{"class":466},[441,1651,463],{"class":462},[441,1653,490],{"class":451},[441,1655,1656],{"class":447}," wrapped",[441,1658,452],{"class":451},[441,1660,997],{"class":447},[441,1662,541],{"class":451},[441,1664,1666,1668,1670,1672,1674,1676,1678,1681,1683,1686],{"class":443,"line":1665},14,[441,1667,1592],{"class":462},[441,1669,1011],{"class":466},[441,1671,463],{"class":462},[441,1673,490],{"class":451},[441,1675,1453],{"class":447},[441,1677,452],{"class":451},[441,1679,1680],{"class":455},"Since",[441,1682,459],{"class":451},[441,1684,1685],{"class":447},"started",[441,1687,1101],{"class":451},[441,1689,1691],{"class":443,"line":1690},15,[441,1692,1693],{"class":451},"        )\n",[441,1695,1697],{"class":443,"line":1696},16,[441,1698,1699],{"class":451},"    })\n",[441,1701,1703],{"class":443,"line":1702},17,[441,1704,691],{"class":451},[394,1706,1707,1708,1711],{},"The ",[405,1709,1710],{},"statusWriter.WriteHeader"," method should store the first status and delegate to the embedded writer. Production middleware may need to preserve optional interfaces supported by the original writer; explain and test those requirements before adding them.",[389,1713,1715],{"id":1714},"summary","Summary",[398,1717,1718,1721,1724,1727,1730],{},[401,1719,1720],{},"Treat logs as named events with stable attributes.",[401,1722,1723],{},"Configure handlers and levels once at startup.",[401,1725,1726],{},"Add request-scoped fields with derived loggers or contextual logging methods.",[401,1728,1729],{},"Add error context in lower layers and log once at the final boundary.",[401,1731,1732],{},"Design redaction before production data reaches the logger.",[394,1734,1735,1736,452],{},"Official reference: ",[1737,1738,1742],"a",{"href":1739,"rel":1740},"https:\u002F\u002Fgo.dev\u002Fblog\u002Fslog",[1741],"nofollow","Structured Logging with slog",[1744,1745],"learning-lesson-complete",{},[1747,1748],"learning-lesson-navigation",{"next":191,"next-label":190,"previous":176,"previous-label":1749},"Command-Line and Configuration",[1751,1752,1753],"style",{},"html pre.shiki code .s45-6, html code.shiki .s45-6{--shiki-light:#268BD2;--shiki-default:#EEFFFF;--shiki-dark:#E06C75}html pre.shiki code .shFME, html code.shiki .shFME{--shiki-light:#657B83;--shiki-default:#89DDFF;--shiki-dark:#ABB2BF}html pre.shiki code .sisdC, html code.shiki .sisdC{--shiki-light:#268BD2;--shiki-default:#82AAFF;--shiki-dark:#61AFEF}html pre.shiki code .sED5a, html code.shiki .sED5a{--shiki-light:#2AA198;--shiki-default:#89DDFF;--shiki-dark:#98C379}html pre.shiki code .sVazx, html code.shiki .sVazx{--shiki-light:#2AA198;--shiki-default:#C3E88D;--shiki-dark:#98C379}html pre.shiki code .st3jj, html code.shiki .st3jj{--shiki-light:#CB4B16;--shiki-default:#F07178;--shiki-dark:#D19A66}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sEOdo, html code.shiki .sEOdo{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#C678DD}html pre.shiki code .syre3, html code.shiki .syre3{--shiki-light:#657B83;--shiki-light-font-style:inherit;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#E06C75;--shiki-dark-font-style:italic}html pre.shiki code .sF6sA, html code.shiki .sF6sA{--shiki-light:#586E75;--shiki-light-font-weight:bold;--shiki-default:#C792EA;--shiki-default-font-weight:inherit;--shiki-dark:#C678DD;--shiki-dark-font-weight:inherit}html pre.shiki code .snwKR, html code.shiki .snwKR{--shiki-light:#CB4B16;--shiki-default:#FFCB6B;--shiki-dark:#E5C07B}html pre.shiki code .su2KV, html code.shiki .su2KV{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#E5C07B}html pre.shiki code .s7Bcg, html code.shiki .s7Bcg{--shiki-light:#859900;--shiki-light-font-style:inherit;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#C678DD;--shiki-dark-font-style:inherit}html pre.shiki code .sRBoR, html code.shiki .sRBoR{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#56B6C2}",{"title":437,"searchDepth":530,"depth":530,"links":1755},[1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766],{"id":391,"depth":530,"text":392},{"id":423,"depth":530,"text":424},{"id":603,"depth":530,"text":604},{"id":848,"depth":530,"text":849},{"id":880,"depth":530,"text":881},{"id":1134,"depth":530,"text":1135},{"id":1244,"depth":530,"text":1245},{"id":1274,"depth":530,"text":1275},{"id":1287,"depth":530,"text":1288},{"id":1327,"depth":530,"text":1328},{"id":1714,"depth":530,"text":1715},"Create useful, searchable logs with log\u002Fslog without exposing sensitive data.","md",null,{},{"icon":183},{"description":1773,"title":180},"Learn Go structured logging with log\u002Fslog, levels, handlers, context, attributes, testing, and secret redaction.","Hl3dAR_ffuWg27GW8C8q_b3b89GKajCcxtitZIRNXIs",[1776,1778],{"title":175,"path":176,"stem":177,"description":1777,"icon":178,"children":-1},"Accept flags and environment variables, validate configuration, and keep startup behaviour predictable.",{"title":190,"path":191,"stem":192,"description":1779,"icon":193,"children":-1},"Connect Go fundamentals to a production-style service without skipping the engineering boundaries.",1794118100879]