[{"data":1,"prerenderedAt":1305},["ShallowReactive",2],{"docs-surround-\u002Fdocs\u002Flog-ingestion":3,"content-query-HTxTXZqZTH":10},[4,7],{"_path":5,"title":6},"\u002Fdocs\u002Fauthentication","Authentication",{"_path":8,"title":9},"\u002Fdocs\u002Fconfiguration","Configuration",{"_path":11,"_dir":12,"_draft":13,"_partial":13,"_locale":14,"title":15,"description":16,"body":17,"_type":1299,"_id":1300,"_source":1301,"_file":1302,"_stem":1303,"_extension":1304},"\u002Fdocs\u002Flog-ingestion","docs",false,"","Log Ingestion","Log levels, structured data, async queue, and how encryption works under the hood.",{"type":18,"children":19,"toc":1287},"root",[20,28,35,41,185,203,209,214,293,300,305,435,440,567,573,586,619,624,630,654,667,779,785,790,850,855,861,866,962,967,1023,1046,1051,1104,1110,1123,1281],{"type":21,"tag":22,"props":23,"children":25},"element","h1",{"id":24},"log-ingestion",[26],{"type":27,"value":15},"text",{"type":21,"tag":29,"props":30,"children":32},"h2",{"id":31},"log-levels",[33],{"type":27,"value":34},"Log levels",{"type":21,"tag":36,"props":37,"children":38},"p",{},[39],{"type":27,"value":40},"The SDK exposes five log levels, each with a corresponding method:",{"type":21,"tag":42,"props":43,"children":44},"table",{},[45,69],{"type":21,"tag":46,"props":47,"children":48},"thead",{},[49],{"type":21,"tag":50,"props":51,"children":52},"tr",{},[53,59,64],{"type":21,"tag":54,"props":55,"children":56},"th",{},[57],{"type":27,"value":58},"Method",{"type":21,"tag":54,"props":60,"children":61},{},[62],{"type":27,"value":63},"Level",{"type":21,"tag":54,"props":65,"children":66},{},[67],{"type":27,"value":68},"Use for",{"type":21,"tag":70,"props":71,"children":72},"tbody",{},[73,97,119,141,163],{"type":21,"tag":50,"props":74,"children":75},{},[76,87,92],{"type":21,"tag":77,"props":78,"children":79},"td",{},[80],{"type":21,"tag":81,"props":82,"children":84},"code",{"className":83},[],[85],{"type":27,"value":86},"lumber.debug()",{"type":21,"tag":77,"props":88,"children":89},{},[90],{"type":27,"value":91},"debug",{"type":21,"tag":77,"props":93,"children":94},{},[95],{"type":27,"value":96},"Verbose diagnostic information",{"type":21,"tag":50,"props":98,"children":99},{},[100,109,114],{"type":21,"tag":77,"props":101,"children":102},{},[103],{"type":21,"tag":81,"props":104,"children":106},{"className":105},[],[107],{"type":27,"value":108},"lumber.info()",{"type":21,"tag":77,"props":110,"children":111},{},[112],{"type":27,"value":113},"info",{"type":21,"tag":77,"props":115,"children":116},{},[117],{"type":27,"value":118},"Normal operational events",{"type":21,"tag":50,"props":120,"children":121},{},[122,131,136],{"type":21,"tag":77,"props":123,"children":124},{},[125],{"type":21,"tag":81,"props":126,"children":128},{"className":127},[],[129],{"type":27,"value":130},"lumber.warn()",{"type":21,"tag":77,"props":132,"children":133},{},[134],{"type":27,"value":135},"warn",{"type":21,"tag":77,"props":137,"children":138},{},[139],{"type":27,"value":140},"Unexpected but recoverable situations",{"type":21,"tag":50,"props":142,"children":143},{},[144,153,158],{"type":21,"tag":77,"props":145,"children":146},{},[147],{"type":21,"tag":81,"props":148,"children":150},{"className":149},[],[151],{"type":27,"value":152},"lumber.error()",{"type":21,"tag":77,"props":154,"children":155},{},[156],{"type":27,"value":157},"error",{"type":21,"tag":77,"props":159,"children":160},{},[161],{"type":27,"value":162},"Failures that need attention",{"type":21,"tag":50,"props":164,"children":165},{},[166,175,180],{"type":21,"tag":77,"props":167,"children":168},{},[169],{"type":21,"tag":81,"props":170,"children":172},{"className":171},[],[173],{"type":27,"value":174},"lumber.fatal()",{"type":21,"tag":77,"props":176,"children":177},{},[178],{"type":27,"value":179},"fatal",{"type":21,"tag":77,"props":181,"children":182},{},[183],{"type":27,"value":184},"Critical failures, app may not continue",{"type":21,"tag":36,"props":186,"children":187},{},[188,194,196,201],{"type":21,"tag":81,"props":189,"children":191},{"className":190},[],[192],{"type":27,"value":193},"lumber.log()",{"type":27,"value":195}," is an alias for ",{"type":21,"tag":81,"props":197,"children":199},{"className":198},[],[200],{"type":27,"value":108},{"type":27,"value":202},".",{"type":21,"tag":29,"props":204,"children":206},{"id":205},"structured-data",[207],{"type":27,"value":208},"Structured data",{"type":21,"tag":36,"props":210,"children":211},{},[212],{"type":27,"value":213},"Every log method accepts an optional second argument for structured metadata:",{"type":21,"tag":215,"props":216,"children":220},"pre",{"className":217,"code":218,"language":219,"meta":14,"style":14},"language-typescript shiki shiki-themes github-dark","lumber.info('User signed in', {\n  userId: user.id,\n  email: user.email,\n  ip: req.ip,\n})\n","typescript",[221],{"type":21,"tag":81,"props":222,"children":223},{"__ignoreMap":14},[224,257,266,275,284],{"type":21,"tag":225,"props":226,"children":229},"span",{"class":227,"line":228},"line",1,[230,236,241,246,252],{"type":21,"tag":225,"props":231,"children":233},{"style":232},"--shiki-default:#E1E4E8",[234],{"type":27,"value":235},"lumber.",{"type":21,"tag":225,"props":237,"children":239},{"style":238},"--shiki-default:#B392F0",[240],{"type":27,"value":113},{"type":21,"tag":225,"props":242,"children":243},{"style":232},[244],{"type":27,"value":245},"(",{"type":21,"tag":225,"props":247,"children":249},{"style":248},"--shiki-default:#9ECBFF",[250],{"type":27,"value":251},"'User signed in'",{"type":21,"tag":225,"props":253,"children":254},{"style":232},[255],{"type":27,"value":256},", {\n",{"type":21,"tag":225,"props":258,"children":260},{"class":227,"line":259},2,[261],{"type":21,"tag":225,"props":262,"children":263},{"style":232},[264],{"type":27,"value":265},"  userId: user.id,\n",{"type":21,"tag":225,"props":267,"children":269},{"class":227,"line":268},3,[270],{"type":21,"tag":225,"props":271,"children":272},{"style":232},[273],{"type":27,"value":274},"  email: user.email,\n",{"type":21,"tag":225,"props":276,"children":278},{"class":227,"line":277},4,[279],{"type":21,"tag":225,"props":280,"children":281},{"style":232},[282],{"type":27,"value":283},"  ip: req.ip,\n",{"type":21,"tag":225,"props":285,"children":287},{"class":227,"line":286},5,[288],{"type":21,"tag":225,"props":289,"children":290},{"style":232},[291],{"type":27,"value":292},"})\n",{"type":21,"tag":294,"props":295,"children":297},"h3",{"id":296},"reserved-fields",[298],{"type":27,"value":299},"Reserved fields",{"type":21,"tag":36,"props":301,"children":302},{},[303],{"type":27,"value":304},"The following top-level keys have special meaning and are handled separately from general metadata:",{"type":21,"tag":42,"props":306,"children":307},{},[308,329],{"type":21,"tag":46,"props":309,"children":310},{},[311],{"type":21,"tag":50,"props":312,"children":313},{},[314,319,324],{"type":21,"tag":54,"props":315,"children":316},{},[317],{"type":27,"value":318},"Field",{"type":21,"tag":54,"props":320,"children":321},{},[322],{"type":27,"value":323},"Type",{"type":21,"tag":54,"props":325,"children":326},{},[327],{"type":27,"value":328},"Description",{"type":21,"tag":70,"props":330,"children":331},{},[332,358,383,409],{"type":21,"tag":50,"props":333,"children":334},{},[335,344,353],{"type":21,"tag":77,"props":336,"children":337},{},[338],{"type":21,"tag":81,"props":339,"children":341},{"className":340},[],[342],{"type":27,"value":343},"requestId",{"type":21,"tag":77,"props":345,"children":346},{},[347],{"type":21,"tag":81,"props":348,"children":350},{"className":349},[],[351],{"type":27,"value":352},"string",{"type":21,"tag":77,"props":354,"children":355},{},[356],{"type":27,"value":357},"Ties a log to a specific HTTP request",{"type":21,"tag":50,"props":359,"children":360},{},[361,370,378],{"type":21,"tag":77,"props":362,"children":363},{},[364],{"type":21,"tag":81,"props":365,"children":367},{"className":366},[],[368],{"type":27,"value":369},"traceId",{"type":21,"tag":77,"props":371,"children":372},{},[373],{"type":21,"tag":81,"props":374,"children":376},{"className":375},[],[377],{"type":27,"value":352},{"type":21,"tag":77,"props":379,"children":380},{},[381],{"type":27,"value":382},"Distributed trace identifier",{"type":21,"tag":50,"props":384,"children":385},{},[386,395,404],{"type":21,"tag":77,"props":387,"children":388},{},[389],{"type":21,"tag":81,"props":390,"children":392},{"className":391},[],[393],{"type":27,"value":394},"context",{"type":21,"tag":77,"props":396,"children":397},{},[398],{"type":21,"tag":81,"props":399,"children":401},{"className":400},[],[402],{"type":27,"value":403},"LogContext",{"type":21,"tag":77,"props":405,"children":406},{},[407],{"type":27,"value":408},"Structured context, merged over the automatic context (pid, hostname, env, and caller code\u002Fline\u002Fcolumn when enabled)",{"type":21,"tag":50,"props":410,"children":411},{},[412,421,430],{"type":21,"tag":77,"props":413,"children":414},{},[415],{"type":21,"tag":81,"props":416,"children":418},{"className":417},[],[419],{"type":27,"value":420},"metadata",{"type":21,"tag":77,"props":422,"children":423},{},[424],{"type":21,"tag":81,"props":425,"children":427},{"className":426},[],[428],{"type":27,"value":429},"Record\u003Cstring, unknown>",{"type":21,"tag":77,"props":431,"children":432},{},[433],{"type":27,"value":434},"Explicit metadata bucket",{"type":21,"tag":36,"props":436,"children":437},{},[438],{"type":27,"value":439},"All other keys are treated as metadata automatically:",{"type":21,"tag":215,"props":441,"children":443},{"className":217,"code":442,"language":219,"meta":14,"style":14},"\u002F\u002F These are equivalent\nlumber.error('DB query failed', { duration: 1200, table: 'users' })\n\nlumber.error('DB query failed', {\n  metadata: { duration: 1200, table: 'users' },\n})\n",[444],{"type":21,"tag":81,"props":445,"children":446},{"__ignoreMap":14},[447,456,502,511,534,559],{"type":21,"tag":225,"props":448,"children":449},{"class":227,"line":228},[450],{"type":21,"tag":225,"props":451,"children":453},{"style":452},"--shiki-default:#6A737D",[454],{"type":27,"value":455},"\u002F\u002F These are equivalent\n",{"type":21,"tag":225,"props":457,"children":458},{"class":227,"line":259},[459,463,467,471,476,481,487,492,497],{"type":21,"tag":225,"props":460,"children":461},{"style":232},[462],{"type":27,"value":235},{"type":21,"tag":225,"props":464,"children":465},{"style":238},[466],{"type":27,"value":157},{"type":21,"tag":225,"props":468,"children":469},{"style":232},[470],{"type":27,"value":245},{"type":21,"tag":225,"props":472,"children":473},{"style":248},[474],{"type":27,"value":475},"'DB query failed'",{"type":21,"tag":225,"props":477,"children":478},{"style":232},[479],{"type":27,"value":480},", { duration: ",{"type":21,"tag":225,"props":482,"children":484},{"style":483},"--shiki-default:#79B8FF",[485],{"type":27,"value":486},"1200",{"type":21,"tag":225,"props":488,"children":489},{"style":232},[490],{"type":27,"value":491},", table: ",{"type":21,"tag":225,"props":493,"children":494},{"style":248},[495],{"type":27,"value":496},"'users'",{"type":21,"tag":225,"props":498,"children":499},{"style":232},[500],{"type":27,"value":501}," })\n",{"type":21,"tag":225,"props":503,"children":504},{"class":227,"line":268},[505],{"type":21,"tag":225,"props":506,"children":508},{"emptyLinePlaceholder":507},true,[509],{"type":27,"value":510},"\n",{"type":21,"tag":225,"props":512,"children":513},{"class":227,"line":277},[514,518,522,526,530],{"type":21,"tag":225,"props":515,"children":516},{"style":232},[517],{"type":27,"value":235},{"type":21,"tag":225,"props":519,"children":520},{"style":238},[521],{"type":27,"value":157},{"type":21,"tag":225,"props":523,"children":524},{"style":232},[525],{"type":27,"value":245},{"type":21,"tag":225,"props":527,"children":528},{"style":248},[529],{"type":27,"value":475},{"type":21,"tag":225,"props":531,"children":532},{"style":232},[533],{"type":27,"value":256},{"type":21,"tag":225,"props":535,"children":536},{"class":227,"line":286},[537,542,546,550,554],{"type":21,"tag":225,"props":538,"children":539},{"style":232},[540],{"type":27,"value":541},"  metadata: { duration: ",{"type":21,"tag":225,"props":543,"children":544},{"style":483},[545],{"type":27,"value":486},{"type":21,"tag":225,"props":547,"children":548},{"style":232},[549],{"type":27,"value":491},{"type":21,"tag":225,"props":551,"children":552},{"style":248},[553],{"type":27,"value":496},{"type":21,"tag":225,"props":555,"children":556},{"style":232},[557],{"type":27,"value":558}," },\n",{"type":21,"tag":225,"props":560,"children":562},{"class":227,"line":561},6,[563],{"type":21,"tag":225,"props":564,"children":565},{"style":232},[566],{"type":27,"value":292},{"type":21,"tag":29,"props":568,"children":570},{"id":569},"async-queue",[571],{"type":27,"value":572},"Async queue",{"type":21,"tag":36,"props":574,"children":575},{},[576,578,584],{"type":27,"value":577},"Logging is non-blocking. When you call any ",{"type":21,"tag":81,"props":579,"children":581},{"className":580},[],[582],{"type":27,"value":583},"lumber.*()",{"type":27,"value":585}," method:",{"type":21,"tag":587,"props":588,"children":589},"ol",{},[590,596,601,614],{"type":21,"tag":591,"props":592,"children":593},"li",{},[594],{"type":27,"value":595},"The payload is encrypted synchronously (in-process, zero network)",{"type":21,"tag":591,"props":597,"children":598},{},[599],{"type":27,"value":600},"The encrypted entry is pushed onto an internal async queue",{"type":21,"tag":591,"props":602,"children":603},{},[604,606,612],{"type":27,"value":605},"The queue drains in the background, sending one ",{"type":21,"tag":81,"props":607,"children":609},{"className":608},[],[610],{"type":27,"value":611},"POST \u002Flogs",{"type":27,"value":613}," request per log, one at a time",{"type":21,"tag":591,"props":615,"children":616},{},[617],{"type":27,"value":618},"Your code continues immediately",{"type":21,"tag":36,"props":620,"children":621},{},[622],{"type":27,"value":623},"This means log calls never add latency to your request path.",{"type":21,"tag":294,"props":625,"children":627},{"id":626},"queue-behavior",[628],{"type":27,"value":629},"Queue behavior",{"type":21,"tag":631,"props":632,"children":633},"ul",{},[634,639,644,649],{"type":21,"tag":591,"props":635,"children":636},{},[637],{"type":27,"value":638},"Logs are sent one at a time, in the order they were enqueued",{"type":21,"tag":591,"props":640,"children":641},{},[642],{"type":27,"value":643},"A network error or any non-2xx response counts as a failed attempt. Each log gets up to 5 attempts, waiting 1s, 2s, 4s, then 8s between them. After the fifth failure the log is dropped and a warning is printed to the console",{"type":21,"tag":591,"props":645,"children":646},{},[647],{"type":27,"value":648},"While a log is being retried, the logs behind it wait their turn",{"type":21,"tag":591,"props":650,"children":651},{},[652],{"type":27,"value":653},"The queue is in-memory - logs are lost if the process exits before they drain",{"type":21,"tag":36,"props":655,"children":656},{},[657,659,665],{"type":27,"value":658},"Always call ",{"type":21,"tag":81,"props":660,"children":662},{"className":661},[],[663],{"type":27,"value":664},"lumber.flush()",{"type":27,"value":666}," during graceful shutdown:",{"type":21,"tag":215,"props":668,"children":670},{"className":217,"code":669,"language":219,"meta":14,"style":14},"process.on('SIGTERM', async () => {\n  await lumber.flush()\n  process.exit(0)\n})\n",[671],{"type":21,"tag":81,"props":672,"children":673},{"__ignoreMap":14},[674,722,745,772],{"type":21,"tag":225,"props":675,"children":676},{"class":227,"line":228},[677,682,687,691,696,701,707,712,717],{"type":21,"tag":225,"props":678,"children":679},{"style":232},[680],{"type":27,"value":681},"process.",{"type":21,"tag":225,"props":683,"children":684},{"style":238},[685],{"type":27,"value":686},"on",{"type":21,"tag":225,"props":688,"children":689},{"style":232},[690],{"type":27,"value":245},{"type":21,"tag":225,"props":692,"children":693},{"style":248},[694],{"type":27,"value":695},"'SIGTERM'",{"type":21,"tag":225,"props":697,"children":698},{"style":232},[699],{"type":27,"value":700},", ",{"type":21,"tag":225,"props":702,"children":704},{"style":703},"--shiki-default:#F97583",[705],{"type":27,"value":706},"async",{"type":21,"tag":225,"props":708,"children":709},{"style":232},[710],{"type":27,"value":711}," () ",{"type":21,"tag":225,"props":713,"children":714},{"style":703},[715],{"type":27,"value":716},"=>",{"type":21,"tag":225,"props":718,"children":719},{"style":232},[720],{"type":27,"value":721}," {\n",{"type":21,"tag":225,"props":723,"children":724},{"class":227,"line":259},[725,730,735,740],{"type":21,"tag":225,"props":726,"children":727},{"style":703},[728],{"type":27,"value":729},"  await",{"type":21,"tag":225,"props":731,"children":732},{"style":232},[733],{"type":27,"value":734}," lumber.",{"type":21,"tag":225,"props":736,"children":737},{"style":238},[738],{"type":27,"value":739},"flush",{"type":21,"tag":225,"props":741,"children":742},{"style":232},[743],{"type":27,"value":744},"()\n",{"type":21,"tag":225,"props":746,"children":747},{"class":227,"line":268},[748,753,758,762,767],{"type":21,"tag":225,"props":749,"children":750},{"style":232},[751],{"type":27,"value":752},"  process.",{"type":21,"tag":225,"props":754,"children":755},{"style":238},[756],{"type":27,"value":757},"exit",{"type":21,"tag":225,"props":759,"children":760},{"style":232},[761],{"type":27,"value":245},{"type":21,"tag":225,"props":763,"children":764},{"style":483},[765],{"type":27,"value":766},"0",{"type":21,"tag":225,"props":768,"children":769},{"style":232},[770],{"type":27,"value":771},")\n",{"type":21,"tag":225,"props":773,"children":774},{"class":227,"line":277},[775],{"type":21,"tag":225,"props":776,"children":777},{"style":232},[778],{"type":27,"value":292},{"type":21,"tag":29,"props":780,"children":782},{"id":781},"how-encryption-works",[783],{"type":27,"value":784},"How encryption works",{"type":21,"tag":36,"props":786,"children":787},{},[788],{"type":27,"value":789},"Every log entry is encrypted with AES-256-GCM before leaving your process:",{"type":21,"tag":587,"props":791,"children":792},{},[793,798,824,845],{"type":21,"tag":591,"props":794,"children":795},{},[796],{"type":27,"value":797},"A 12-byte random nonce (IV) is generated per log entry",{"type":21,"tag":591,"props":799,"children":800},{},[801,803,808,809,814,816,822],{"type":27,"value":802},"The JSON payload (message, ",{"type":21,"tag":81,"props":804,"children":806},{"className":805},[],[807],{"type":27,"value":343},{"type":27,"value":700},{"type":21,"tag":81,"props":810,"children":812},{"className":811},[],[813],{"type":27,"value":369},{"type":27,"value":815},", context, and metadata) is encrypted using your ",{"type":21,"tag":81,"props":817,"children":819},{"className":818},[],[820],{"type":27,"value":821},"encryptionKey",{"type":27,"value":823}," and the nonce",{"type":21,"tag":591,"props":825,"children":826},{},[827,829,835,837,843],{"type":27,"value":828},"The API receives the log level plus ",{"type":21,"tag":81,"props":830,"children":832},{"className":831},[],[833],{"type":27,"value":834},"{ nonce, payload, keyVersion }",{"type":27,"value":836},", where ",{"type":21,"tag":81,"props":838,"children":840},{"className":839},[],[841],{"type":27,"value":842},"payload",{"type":27,"value":844}," is the 16-byte GCM auth tag followed by the ciphertext",{"type":21,"tag":591,"props":846,"children":847},{},[848],{"type":27,"value":849},"Decryption happens on-device in the Lumber mobile app",{"type":21,"tag":36,"props":851,"children":852},{},[853],{"type":27,"value":854},"The log level is the one field sent and stored unencrypted, so Lumber can filter by level and decide when to send push alerts. The Lumber API cannot read your log content at any point. Even if the API were compromised, your logs remain unreadable without your encryption key.",{"type":21,"tag":29,"props":856,"children":858},{"id":857},"context-capture",[859],{"type":27,"value":860},"Context capture",{"type":21,"tag":36,"props":862,"children":863},{},[864],{"type":27,"value":865},"By default, the SDK automatically attaches environment context to every log:",{"type":21,"tag":215,"props":867,"children":869},{"className":217,"code":868,"language":219,"meta":14,"style":14},"\u002F\u002F Captured once at lumber.config() time\n{\n  pid: 12345,\n  hostname: 'my-server',\n  env: 'production',\n}\n",[870],{"type":21,"tag":81,"props":871,"children":872},{"__ignoreMap":14},[873,881,889,912,933,954],{"type":21,"tag":225,"props":874,"children":875},{"class":227,"line":228},[876],{"type":21,"tag":225,"props":877,"children":878},{"style":452},[879],{"type":27,"value":880},"\u002F\u002F Captured once at lumber.config() time\n",{"type":21,"tag":225,"props":882,"children":883},{"class":227,"line":259},[884],{"type":21,"tag":225,"props":885,"children":886},{"style":232},[887],{"type":27,"value":888},"{\n",{"type":21,"tag":225,"props":890,"children":891},{"class":227,"line":268},[892,897,902,907],{"type":21,"tag":225,"props":893,"children":894},{"style":238},[895],{"type":27,"value":896},"  pid",{"type":21,"tag":225,"props":898,"children":899},{"style":232},[900],{"type":27,"value":901},": ",{"type":21,"tag":225,"props":903,"children":904},{"style":483},[905],{"type":27,"value":906},"12345",{"type":21,"tag":225,"props":908,"children":909},{"style":232},[910],{"type":27,"value":911},",\n",{"type":21,"tag":225,"props":913,"children":914},{"class":227,"line":277},[915,920,924,929],{"type":21,"tag":225,"props":916,"children":917},{"style":238},[918],{"type":27,"value":919},"  hostname",{"type":21,"tag":225,"props":921,"children":922},{"style":232},[923],{"type":27,"value":901},{"type":21,"tag":225,"props":925,"children":926},{"style":248},[927],{"type":27,"value":928},"'my-server'",{"type":21,"tag":225,"props":930,"children":931},{"style":232},[932],{"type":27,"value":911},{"type":21,"tag":225,"props":934,"children":935},{"class":227,"line":286},[936,941,945,950],{"type":21,"tag":225,"props":937,"children":938},{"style":238},[939],{"type":27,"value":940},"  env",{"type":21,"tag":225,"props":942,"children":943},{"style":232},[944],{"type":27,"value":901},{"type":21,"tag":225,"props":946,"children":947},{"style":248},[948],{"type":27,"value":949},"'production'",{"type":21,"tag":225,"props":951,"children":952},{"style":232},[953],{"type":27,"value":911},{"type":21,"tag":225,"props":955,"children":956},{"class":227,"line":561},[957],{"type":21,"tag":225,"props":958,"children":959},{"style":232},[960],{"type":27,"value":961},"}\n",{"type":21,"tag":36,"props":963,"children":964},{},[965],{"type":27,"value":966},"To capture the caller file and line number per log:",{"type":21,"tag":215,"props":968,"children":970},{"className":217,"code":969,"language":219,"meta":14,"style":14},"lumber.config({\n  \u002F\u002F ...\n  context: { caller: true },\n})\n",[971],{"type":21,"tag":81,"props":972,"children":973},{"__ignoreMap":14},[974,991,999,1016],{"type":21,"tag":225,"props":975,"children":976},{"class":227,"line":228},[977,981,986],{"type":21,"tag":225,"props":978,"children":979},{"style":232},[980],{"type":27,"value":235},{"type":21,"tag":225,"props":982,"children":983},{"style":238},[984],{"type":27,"value":985},"config",{"type":21,"tag":225,"props":987,"children":988},{"style":232},[989],{"type":27,"value":990},"({\n",{"type":21,"tag":225,"props":992,"children":993},{"class":227,"line":259},[994],{"type":21,"tag":225,"props":995,"children":996},{"style":452},[997],{"type":27,"value":998},"  \u002F\u002F ...\n",{"type":21,"tag":225,"props":1000,"children":1001},{"class":227,"line":268},[1002,1007,1012],{"type":21,"tag":225,"props":1003,"children":1004},{"style":232},[1005],{"type":27,"value":1006},"  context: { caller: ",{"type":21,"tag":225,"props":1008,"children":1009},{"style":483},[1010],{"type":27,"value":1011},"true",{"type":21,"tag":225,"props":1013,"children":1014},{"style":232},[1015],{"type":27,"value":558},{"type":21,"tag":225,"props":1017,"children":1018},{"class":227,"line":277},[1019],{"type":21,"tag":225,"props":1020,"children":1021},{"style":232},[1022],{"type":27,"value":292},{"type":21,"tag":1024,"props":1025,"children":1026},"blockquote",{},[1027],{"type":21,"tag":36,"props":1028,"children":1029},{},[1030,1036,1038,1044],{"type":21,"tag":1031,"props":1032,"children":1033},"strong",{},[1034],{"type":27,"value":1035},"Note:",{"type":27,"value":1037}," Caller capture uses ",{"type":21,"tag":81,"props":1039,"children":1041},{"className":1040},[],[1042],{"type":27,"value":1043},"Error.stack",{"type":27,"value":1045}," parsing and adds minor per-call overhead. Use it in development or low-throughput scenarios.",{"type":21,"tag":36,"props":1047,"children":1048},{},[1049],{"type":27,"value":1050},"To disable context entirely:",{"type":21,"tag":215,"props":1052,"children":1054},{"className":217,"code":1053,"language":219,"meta":14,"style":14},"lumber.config({\n  \u002F\u002F ...\n  context: false,\n})\n",[1055],{"type":21,"tag":81,"props":1056,"children":1057},{"__ignoreMap":14},[1058,1073,1080,1097],{"type":21,"tag":225,"props":1059,"children":1060},{"class":227,"line":228},[1061,1065,1069],{"type":21,"tag":225,"props":1062,"children":1063},{"style":232},[1064],{"type":27,"value":235},{"type":21,"tag":225,"props":1066,"children":1067},{"style":238},[1068],{"type":27,"value":985},{"type":21,"tag":225,"props":1070,"children":1071},{"style":232},[1072],{"type":27,"value":990},{"type":21,"tag":225,"props":1074,"children":1075},{"class":227,"line":259},[1076],{"type":21,"tag":225,"props":1077,"children":1078},{"style":452},[1079],{"type":27,"value":998},{"type":21,"tag":225,"props":1081,"children":1082},{"class":227,"line":268},[1083,1088,1093],{"type":21,"tag":225,"props":1084,"children":1085},{"style":232},[1086],{"type":27,"value":1087},"  context: ",{"type":21,"tag":225,"props":1089,"children":1090},{"style":483},[1091],{"type":27,"value":1092},"false",{"type":21,"tag":225,"props":1094,"children":1095},{"style":232},[1096],{"type":27,"value":911},{"type":21,"tag":225,"props":1098,"children":1099},{"class":227,"line":277},[1100],{"type":21,"tag":225,"props":1101,"children":1102},{"style":232},[1103],{"type":27,"value":292},{"type":21,"tag":29,"props":1105,"children":1107},{"id":1106},"using-the-class-directly",[1108],{"type":27,"value":1109},"Using the class directly",{"type":21,"tag":36,"props":1111,"children":1112},{},[1113,1115,1121],{"type":27,"value":1114},"For multiple isolated clients (e.g., per-tenant logging), use ",{"type":21,"tag":81,"props":1116,"children":1118},{"className":1117},[],[1119],{"type":27,"value":1120},"LumberClient",{"type":27,"value":1122}," instead of the singleton:",{"type":21,"tag":215,"props":1124,"children":1126},{"className":217,"code":1125,"language":219,"meta":14,"style":14},"import { LumberClient } from '@infinitetoken\u002Flumber'\n\nconst logger = new LumberClient({\n  apiKey: tenantApiKey,\n  encryptionKey: tenantEncryptionKey,\n})\n\nlogger.info('Tenant action', { tenantId: '123' })\nawait logger.flush()\n",[1127],{"type":21,"tag":81,"props":1128,"children":1129},{"__ignoreMap":14},[1130,1153,1160,1192,1200,1208,1215,1223,1259],{"type":21,"tag":225,"props":1131,"children":1132},{"class":227,"line":228},[1133,1138,1143,1148],{"type":21,"tag":225,"props":1134,"children":1135},{"style":703},[1136],{"type":27,"value":1137},"import",{"type":21,"tag":225,"props":1139,"children":1140},{"style":232},[1141],{"type":27,"value":1142}," { LumberClient } ",{"type":21,"tag":225,"props":1144,"children":1145},{"style":703},[1146],{"type":27,"value":1147},"from",{"type":21,"tag":225,"props":1149,"children":1150},{"style":248},[1151],{"type":27,"value":1152}," '@infinitetoken\u002Flumber'\n",{"type":21,"tag":225,"props":1154,"children":1155},{"class":227,"line":259},[1156],{"type":21,"tag":225,"props":1157,"children":1158},{"emptyLinePlaceholder":507},[1159],{"type":27,"value":510},{"type":21,"tag":225,"props":1161,"children":1162},{"class":227,"line":268},[1163,1168,1173,1178,1183,1188],{"type":21,"tag":225,"props":1164,"children":1165},{"style":703},[1166],{"type":27,"value":1167},"const",{"type":21,"tag":225,"props":1169,"children":1170},{"style":483},[1171],{"type":27,"value":1172}," logger",{"type":21,"tag":225,"props":1174,"children":1175},{"style":703},[1176],{"type":27,"value":1177}," =",{"type":21,"tag":225,"props":1179,"children":1180},{"style":703},[1181],{"type":27,"value":1182}," new",{"type":21,"tag":225,"props":1184,"children":1185},{"style":238},[1186],{"type":27,"value":1187}," LumberClient",{"type":21,"tag":225,"props":1189,"children":1190},{"style":232},[1191],{"type":27,"value":990},{"type":21,"tag":225,"props":1193,"children":1194},{"class":227,"line":277},[1195],{"type":21,"tag":225,"props":1196,"children":1197},{"style":232},[1198],{"type":27,"value":1199},"  apiKey: tenantApiKey,\n",{"type":21,"tag":225,"props":1201,"children":1202},{"class":227,"line":286},[1203],{"type":21,"tag":225,"props":1204,"children":1205},{"style":232},[1206],{"type":27,"value":1207},"  encryptionKey: tenantEncryptionKey,\n",{"type":21,"tag":225,"props":1209,"children":1210},{"class":227,"line":561},[1211],{"type":21,"tag":225,"props":1212,"children":1213},{"style":232},[1214],{"type":27,"value":292},{"type":21,"tag":225,"props":1216,"children":1218},{"class":227,"line":1217},7,[1219],{"type":21,"tag":225,"props":1220,"children":1221},{"emptyLinePlaceholder":507},[1222],{"type":27,"value":510},{"type":21,"tag":225,"props":1224,"children":1226},{"class":227,"line":1225},8,[1227,1232,1236,1240,1245,1250,1255],{"type":21,"tag":225,"props":1228,"children":1229},{"style":232},[1230],{"type":27,"value":1231},"logger.",{"type":21,"tag":225,"props":1233,"children":1234},{"style":238},[1235],{"type":27,"value":113},{"type":21,"tag":225,"props":1237,"children":1238},{"style":232},[1239],{"type":27,"value":245},{"type":21,"tag":225,"props":1241,"children":1242},{"style":248},[1243],{"type":27,"value":1244},"'Tenant action'",{"type":21,"tag":225,"props":1246,"children":1247},{"style":232},[1248],{"type":27,"value":1249},", { tenantId: ",{"type":21,"tag":225,"props":1251,"children":1252},{"style":248},[1253],{"type":27,"value":1254},"'123'",{"type":21,"tag":225,"props":1256,"children":1257},{"style":232},[1258],{"type":27,"value":501},{"type":21,"tag":225,"props":1260,"children":1262},{"class":227,"line":1261},9,[1263,1268,1273,1277],{"type":21,"tag":225,"props":1264,"children":1265},{"style":703},[1266],{"type":27,"value":1267},"await",{"type":21,"tag":225,"props":1269,"children":1270},{"style":232},[1271],{"type":27,"value":1272}," logger.",{"type":21,"tag":225,"props":1274,"children":1275},{"style":238},[1276],{"type":27,"value":739},{"type":21,"tag":225,"props":1278,"children":1279},{"style":232},[1280],{"type":27,"value":744},{"type":21,"tag":1282,"props":1283,"children":1284},"style",{},[1285],{"type":27,"value":1286},"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);}",{"title":14,"searchDepth":259,"depth":259,"links":1288},[1289,1290,1293,1296,1297,1298],{"id":31,"depth":259,"text":34},{"id":205,"depth":259,"text":208,"children":1291},[1292],{"id":296,"depth":268,"text":299},{"id":569,"depth":259,"text":572,"children":1294},[1295],{"id":626,"depth":268,"text":629},{"id":781,"depth":259,"text":784},{"id":857,"depth":259,"text":860},{"id":1106,"depth":259,"text":1109},"markdown","content:docs:3.log-ingestion.md","content","docs\u002F3.log-ingestion.md","docs\u002F3.log-ingestion","md",1792656860500]