[{"data":1,"prerenderedAt":735},["ShallowReactive",2],{"navigation_docs":3,"-adapters-overview":75,"-adapters-overview-surround":730},[4,30,50],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","/getting-started","1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","/getting-started/introduction","1.getting-started/1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","/getting-started/quick-start","1.getting-started/3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","/getting-started/agent-skills","1.getting-started/4.agent-skills","i-lucide-sparkles",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Core Concepts","/core-concepts","2.core-concepts",[35,40,45],{"title":36,"path":37,"stem":38,"icon":39},"Wide Events","/core-concepts/wide-events","2.core-concepts/1.wide-events","i-lucide-layers",{"title":41,"path":42,"stem":43,"icon":44},"Structured Errors","/core-concepts/structured-errors","2.core-concepts/2.structured-errors","i-lucide-shield-alert",{"title":46,"path":47,"stem":48,"icon":49},"Best Practices","/core-concepts/best-practices","2.core-concepts/3.best-practices","i-lucide-shield-check",{"title":51,"path":52,"stem":53,"children":54,"page":29},"Adapters","/adapters","3.adapters",[55,60,65,70],{"title":56,"path":57,"stem":58,"icon":59},"Overview","/adapters/overview","3.adapters/1.overview","i-custom-plug",{"title":61,"path":62,"stem":63,"icon":64},"Axiom","/adapters/axiom","3.adapters/2.axiom","i-custom-axiom",{"title":66,"path":67,"stem":68,"icon":69},"OTLP","/adapters/otlp","3.adapters/3.otlp","i-simple-icons-opentelemetry",{"title":71,"path":72,"stem":73,"icon":74},"Custom Adapters","/adapters/custom","3.adapters/4.custom","i-lucide-code",{"id":76,"title":77,"body":78,"description":721,"extension":722,"links":723,"meta":726,"navigation":727,"path":57,"seo":728,"stem":58,"__hash__":729},"docs/3.adapters/1.overview.md","Adapters Overview",{"type":79,"value":80,"toc":714},"minimark",[81,85,90,103,229,242,246,260,264,267,460,464,471,548,565,569,572,626,710],[82,83,84],"p",{},"Adapters let you send logs to external observability platforms. evlog provides built-in adapters for popular services, and you can create custom adapters for any destination.",[86,87,89],"h2",{"id":88},"how-adapters-work","How Adapters Work",[82,91,92,93,97,98,102],{},"Adapters hook into the ",[94,95,96],"code",{},"evlog:drain"," event, which fires after each request completes. The drain runs in ",[99,100,101],"strong",{},"fire-and-forget"," mode, meaning it never blocks the HTTP response.",[104,105,111],"pre",{"className":106,"code":107,"filename":108,"language":109,"meta":110,"style":110},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createAxiomDrain } from 'evlog/axiom'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createAxiomDrain())\n})\n","server/plugins/evlog-drain.ts","typescript","",[94,112,113,146,153,185,220],{"__ignoreMap":110},[114,115,118,122,126,130,133,136,139,143],"span",{"class":116,"line":117},"line",1,[114,119,121],{"class":120},"s7zQu","import",[114,123,125],{"class":124},"sMK4o"," {",[114,127,129],{"class":128},"sTEyZ"," createAxiomDrain",[114,131,132],{"class":124}," }",[114,134,135],{"class":120}," from",[114,137,138],{"class":124}," '",[114,140,142],{"class":141},"sfazB","evlog/axiom",[114,144,145],{"class":124},"'\n",[114,147,149],{"class":116,"line":148},2,[114,150,152],{"emptyLinePlaceholder":151},true,"\n",[114,154,156,159,162,166,169,171,175,178,182],{"class":116,"line":155},3,[114,157,158],{"class":120},"export",[114,160,161],{"class":120}," default",[114,163,165],{"class":164},"s2Zo4"," defineNitroPlugin",[114,167,168],{"class":128},"(",[114,170,168],{"class":124},[114,172,174],{"class":173},"sHdIc","nitroApp",[114,176,177],{"class":124},")",[114,179,181],{"class":180},"spNyl"," =>",[114,183,184],{"class":124}," {\n",[114,186,188,191,194,197,199,202,205,208,210,212,215,217],{"class":116,"line":187},4,[114,189,190],{"class":128},"  nitroApp",[114,192,193],{"class":124},".",[114,195,196],{"class":128},"hooks",[114,198,193],{"class":124},[114,200,201],{"class":164},"hook",[114,203,168],{"class":204},"swJcz",[114,206,207],{"class":124},"'",[114,209,96],{"class":141},[114,211,207],{"class":124},[114,213,214],{"class":124},",",[114,216,129],{"class":164},[114,218,219],{"class":204},"())\n",[114,221,223,226],{"class":116,"line":222},5,[114,224,225],{"class":124},"}",[114,227,228],{"class":128},")\n",[230,231,234,237,238,241],"callout",{"color":232,"icon":233},"info","i-lucide-cloud",[99,235,236],{},"Serverless Support:"," On Cloudflare Workers and Vercel Edge, evlog automatically uses ",[94,239,240],{},"waitUntil()"," to ensure drains complete before the runtime terminates. No additional configuration needed.",[86,243,245],{"id":244},"available-adapters","Available Adapters",[247,248,249,253,256],"card-group",{},[250,251,252],"card",{"icon":64,"title":61,"to":62},"Send logs to Axiom for powerful querying and dashboards.",[250,254,255],{"icon":69,"title":66,"to":67},"OpenTelemetry Protocol for Grafana, Datadog, Honeycomb, and more.",[250,257,259],{"icon":74,"title":258,"to":72},"Custom","Build your own adapter for any destination.",[86,261,263],{"id":262},"multiple-destinations","Multiple Destinations",[82,265,266],{},"Send logs to multiple services simultaneously:",[104,268,270],{"className":106,"code":269,"filename":108,"language":109,"meta":110,"style":110},"import { createAxiomDrain } from 'evlog/axiom'\nimport { createOTLPDrain } from 'evlog/otlp'\n\nexport default defineNitroPlugin((nitroApp) => {\n  const axiom = createAxiomDrain()\n  const otlp = createOTLPDrain()\n\n  nitroApp.hooks.hook('evlog:drain', async (ctx) => {\n    await Promise.allSettled([axiom(ctx), otlp(ctx)])\n  })\n})\n",[94,271,272,290,310,314,334,350,364,369,407,445,453],{"__ignoreMap":110},[114,273,274,276,278,280,282,284,286,288],{"class":116,"line":117},[114,275,121],{"class":120},[114,277,125],{"class":124},[114,279,129],{"class":128},[114,281,132],{"class":124},[114,283,135],{"class":120},[114,285,138],{"class":124},[114,287,142],{"class":141},[114,289,145],{"class":124},[114,291,292,294,296,299,301,303,305,308],{"class":116,"line":148},[114,293,121],{"class":120},[114,295,125],{"class":124},[114,297,298],{"class":128}," createOTLPDrain",[114,300,132],{"class":124},[114,302,135],{"class":120},[114,304,138],{"class":124},[114,306,307],{"class":141},"evlog/otlp",[114,309,145],{"class":124},[114,311,312],{"class":116,"line":155},[114,313,152],{"emptyLinePlaceholder":151},[114,315,316,318,320,322,324,326,328,330,332],{"class":116,"line":187},[114,317,158],{"class":120},[114,319,161],{"class":120},[114,321,165],{"class":164},[114,323,168],{"class":128},[114,325,168],{"class":124},[114,327,174],{"class":173},[114,329,177],{"class":124},[114,331,181],{"class":180},[114,333,184],{"class":124},[114,335,336,339,342,345,347],{"class":116,"line":222},[114,337,338],{"class":180},"  const",[114,340,341],{"class":128}," axiom",[114,343,344],{"class":124}," =",[114,346,129],{"class":164},[114,348,349],{"class":204},"()\n",[114,351,353,355,358,360,362],{"class":116,"line":352},6,[114,354,338],{"class":180},[114,356,357],{"class":128}," otlp",[114,359,344],{"class":124},[114,361,298],{"class":164},[114,363,349],{"class":204},[114,365,367],{"class":116,"line":366},7,[114,368,152],{"emptyLinePlaceholder":151},[114,370,372,374,376,378,380,382,384,386,388,390,392,395,398,401,403,405],{"class":116,"line":371},8,[114,373,190],{"class":128},[114,375,193],{"class":124},[114,377,196],{"class":128},[114,379,193],{"class":124},[114,381,201],{"class":164},[114,383,168],{"class":204},[114,385,207],{"class":124},[114,387,96],{"class":141},[114,389,207],{"class":124},[114,391,214],{"class":124},[114,393,394],{"class":180}," async",[114,396,397],{"class":124}," (",[114,399,400],{"class":173},"ctx",[114,402,177],{"class":124},[114,404,181],{"class":180},[114,406,184],{"class":124},[114,408,410,413,417,419,422,425,428,430,432,434,436,438,440,442],{"class":116,"line":409},9,[114,411,412],{"class":120},"    await",[114,414,416],{"class":415},"sBMFI"," Promise",[114,418,193],{"class":124},[114,420,421],{"class":164},"allSettled",[114,423,424],{"class":204},"([",[114,426,427],{"class":164},"axiom",[114,429,168],{"class":204},[114,431,400],{"class":128},[114,433,177],{"class":204},[114,435,214],{"class":124},[114,437,357],{"class":164},[114,439,168],{"class":204},[114,441,400],{"class":128},[114,443,444],{"class":204},")])\n",[114,446,448,451],{"class":116,"line":447},10,[114,449,450],{"class":124},"  }",[114,452,228],{"class":204},[114,454,456,458],{"class":116,"line":455},11,[114,457,225],{"class":124},[114,459,228],{"class":128},[86,461,463],{"id":462},"drain-context","Drain Context",[82,465,466,467,470],{},"Every adapter receives a ",[94,468,469],{},"DrainContext"," with:",[472,473,474,490],"table",{},[475,476,477],"thead",{},[478,479,480,484,487],"tr",{},[481,482,483],"th",{},"Field",[481,485,486],{},"Type",[481,488,489],{},"Description",[491,492,493,509,534],"tbody",{},[478,494,495,501,506],{},[496,497,498],"td",{},[94,499,500],{},"event",[496,502,503],{},[94,504,505],{},"WideEvent",[496,507,508],{},"The complete log event with all accumulated context",[478,510,511,516,521],{},[496,512,513],{},[94,514,515],{},"request",[496,517,518],{},[94,519,520],{},"object",[496,522,523,524,527,528,527,531,177],{},"Request metadata (",[94,525,526],{},"method",", ",[94,529,530],{},"path",[94,532,533],{},"requestId",[478,535,536,541,545],{},[496,537,538],{},[94,539,540],{},"headers",[496,542,543],{},[94,544,520],{},[496,546,547],{},"Safe HTTP headers (sensitive headers are filtered)",[230,549,551,554,555,527,558,527,561,564],{"color":550,"icon":49},"success",[99,552,553],{},"Security:"," Sensitive headers (",[94,556,557],{},"authorization",[94,559,560],{},"cookie",[94,562,563],{},"x-api-key",", etc.) are automatically filtered and never passed to adapters.",[86,566,568],{"id":567},"zero-config-setup","Zero-Config Setup",[82,570,571],{},"All adapters support automatic configuration via environment variables. No code changes needed when deploying to different environments:",[104,573,578],{"className":574,"code":575,"filename":576,"language":577,"meta":110,"style":110},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Axiom\nNUXT_AXIOM_TOKEN=xaat-xxx\nNUXT_AXIOM_DATASET=my-logs\n\n# OTLP\nNUXT_OTLP_ENDPOINT=https://otlp.example.com\n",".env","bash",[94,579,580,586,597,607,611,616],{"__ignoreMap":110},[114,581,582],{"class":116,"line":117},[114,583,585],{"class":584},"sHwdD","# Axiom\n",[114,587,588,591,594],{"class":116,"line":148},[114,589,590],{"class":128},"NUXT_AXIOM_TOKEN",[114,592,593],{"class":124},"=",[114,595,596],{"class":141},"xaat-xxx\n",[114,598,599,602,604],{"class":116,"line":155},[114,600,601],{"class":128},"NUXT_AXIOM_DATASET",[114,603,593],{"class":124},[114,605,606],{"class":141},"my-logs\n",[114,608,609],{"class":116,"line":187},[114,610,152],{"emptyLinePlaceholder":151},[114,612,613],{"class":116,"line":222},[114,614,615],{"class":584},"# OTLP\n",[114,617,618,621,623],{"class":116,"line":352},[114,619,620],{"class":128},"NUXT_OTLP_ENDPOINT",[114,622,593],{"class":124},[114,624,625],{"class":141},"https://otlp.example.com\n",[104,627,629],{"className":106,"code":628,"filename":108,"language":109,"meta":110,"style":110},"import { createAxiomDrain } from 'evlog/axiom'\n\nexport default defineNitroPlugin((nitroApp) => {\n  // Automatically reads from env vars\n  nitroApp.hooks.hook('evlog:drain', createAxiomDrain())\n})\n",[94,630,631,649,653,673,678,704],{"__ignoreMap":110},[114,632,633,635,637,639,641,643,645,647],{"class":116,"line":117},[114,634,121],{"class":120},[114,636,125],{"class":124},[114,638,129],{"class":128},[114,640,132],{"class":124},[114,642,135],{"class":120},[114,644,138],{"class":124},[114,646,142],{"class":141},[114,648,145],{"class":124},[114,650,651],{"class":116,"line":148},[114,652,152],{"emptyLinePlaceholder":151},[114,654,655,657,659,661,663,665,667,669,671],{"class":116,"line":155},[114,656,158],{"class":120},[114,658,161],{"class":120},[114,660,165],{"class":164},[114,662,168],{"class":128},[114,664,168],{"class":124},[114,666,174],{"class":173},[114,668,177],{"class":124},[114,670,181],{"class":180},[114,672,184],{"class":124},[114,674,675],{"class":116,"line":187},[114,676,677],{"class":584},"  // Automatically reads from env vars\n",[114,679,680,682,684,686,688,690,692,694,696,698,700,702],{"class":116,"line":222},[114,681,190],{"class":128},[114,683,193],{"class":124},[114,685,196],{"class":128},[114,687,193],{"class":124},[114,689,201],{"class":164},[114,691,168],{"class":204},[114,693,207],{"class":124},[114,695,96],{"class":141},[114,697,207],{"class":124},[114,699,214],{"class":124},[114,701,129],{"class":164},[114,703,219],{"class":204},[114,705,706,708],{"class":116,"line":352},[114,707,225],{"class":124},[114,709,228],{"class":128},[711,712,713],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":110,"searchDepth":148,"depth":148,"links":715},[716,717,718,719,720],{"id":88,"depth":148,"text":89},{"id":244,"depth":148,"text":245},{"id":262,"depth":148,"text":263},{"id":462,"depth":148,"text":463},{"id":567,"depth":148,"text":568},"Send your logs to external services with evlog adapters. Built-in support for Axiom, OTLP, and custom destinations.","md",[724,725],{"label":61,"icon":64,"to":62},{"label":66,"icon":69,"to":67},{},{"title":56,"icon":59},{"title":77,"description":721},"88dhwAnD9_dn8G_-GJKONUHg2q80q_DIUUPIBZDoeP0",[731,733],{"title":46,"path":47,"stem":48,"description":732,"icon":49,"children":-1},"Security guidelines, data sanitization, and production tips for evlog. Learn what not to log and how to protect sensitive data.",{"title":61,"path":62,"stem":63,"description":734,"icon":64,"children":-1},"Send logs to Axiom for powerful querying, dashboards, and alerting. Zero-config setup with environment variables.",1770241221237]