Commit 5489c0d
authored
feat(library): add evlog observability library (#110)
* feat(library): add evlog observability library
Adds evlog (wide-event structured logging) as a new per-app library
option under a new Observability category. Supports Next.js, Hono,
TanStack Start, and Node stacks.
- META entry with evlog ^2.11.0 and nitro devDep scoped to tanstack-start
- Next.js: lib/evlog.ts (createEvlog + createInstrumentation),
instrumentation.ts (defineNodeInstrumentation), proxy.ts rewrites
return value through evlogMiddleware when selected
- Hono: initLogger + evlog() middleware wired into src/app.ts, replaces
hono/logger and adds EvlogVariables typing
- TanStack Start: nitro.config.ts module registration with
experimental.asyncContext, __root.tsx wires evlogErrorHandler via
server middleware
- Node: initLogger + createLogger wire-up in src/index.ts
- Composes cleanly with better-auth in Next.js proxy
- Full integration test covering all four stacks, turborepo multi-app,
and no-evlog regression
* fix(library): improve evlog Hono error handler and simplify Node wire-up
- Hono: app.onError uses c.get('log').error(err) + parseError for
structured error responses instead of raw console.error
- Node: remove demo createLogger/set/emit, keep only initLogger + log.info
for minimal wire-up consistent with other stacks
- Add test for Hono structured error handling
* fix(library): remove captureOutput from evlog instrumentation
* fix(library): move instrumentation.ts into src/ for Next.js convention
Next.js looks for instrumentation.ts inside src/ when using the src/
directory convention. Fixes double output caused by incorrect file
placement.
* docs(modules): add evlog observability documentation page
Adds Observability category to module docs sidebar and evlog.mdx
covering per-stack wire-up: Next.js (factory + instrumentation +
proxy middleware), Hono (initLogger + evlog middleware + parseError),
TanStack Start (nitro module + error handler), and Node (initLogger).1 parent 9fb0206 commit 5489c0d
File tree
13 files changed
+515
-3
lines changed- apps
- cli
- src
- templates
- libraries/evlog
- src
- lib
- stack
- hono/src
- nextjs/src
- node/src
- tanstack-start/src/routes
- tests/integration
- www/content/docs/modules
- observability
13 files changed
+515
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
327 | 341 | | |
328 | 342 | | |
329 | 343 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
7 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
8 | 22 | | |
| 23 | + | |
9 | 24 | | |
10 | 25 | | |
11 | 26 | | |
| |||
42 | 57 | | |
43 | 58 | | |
44 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
45 | 73 | | |
46 | 74 | | |
47 | 75 | | |
| |||
51 | 79 | | |
52 | 80 | | |
53 | 81 | | |
| 82 | + | |
54 | 83 | | |
55 | 84 | | |
56 | 85 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
| 6 | + | |
2 | 7 | | |
3 | 8 | | |
4 | 9 | | |
| |||
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
| |||
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
24 | 36 | | |
| 37 | + | |
25 | 38 | | |
26 | 39 | | |
27 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
1 | 10 | | |
| 11 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
0 commit comments