stacktale
Stack traces that tell the tale.
A Logback appender that turns Java errors into AI-ready reports. Add one dependency —
and every error your app logs becomes a complete, token-efficient report in
errors-ai.log, shaped for a reader that increasingly triages your errors: an AI
assistant or an automated agent. It's written alongside your normal logs — the full
stack trace stays exactly where it is.
Stack trace → stacktale report → paste to your AI → fixed. One paste, no interrogation. See it live →
Why
The Java error log format was designed in the 90s for a human with grep, and for that
reader it works — you learn where to look, what to skip, and when the framework frame you'd
ignore is actually the clue. But an AI assistant reads an error with none of that muscle
memory: every one of those 60 lines is context and token cost, and the information it needs
most is scattered across the log or never recorded at all:
- What happened before the error. The log lines that explain the failure exist, but
they're interleaved with 20 other threads, hundreds of lines above the stack trace.
- The values involved.
NullPointerException at OrderService.java:87 forces the AI
to guess. The message args, the MDC, the state inside the exception — all captured at
log time, all scattered or dropped.
- The environment. App version, git commit, Java version, profile: an AI asks for
these in half of all debugging sessions, because no log line carries them.
So every pasted-log debugging session becomes an interrogation: 5–10 messages of the AI
asking for context that existed at the moment of the error and was thrown away.
stacktale captures that context at the source and writes it as one structured block.
Post-processing can't do this — by the time the log is written, the story is gone.
And it distills rather than discards: your culprit frame and the full wrapped by:
chain (where a proxy or reflection clue usually hides) stay; only repetitive framework runs
collapse into a labeled count like … 30 collapsed (spring ×20, tomcat ×10). When you want
all 60 lines, they're still in your normal log, untouched.
What the AI sees
A real report produced by DemoApp
— an order flow where a cache miss returns null, nobody checks it, and the NPE gets
wrapped in a domain exception:
━━━ ERROR #c73cf755 ━━━ 2026-07-09 20:46:02.315 thread=main ━━━
NullPointerException: Cannot invoke "DemoApp$Customer.email()" because "customer" is null
at DemoApp.confirmOrder(DemoApp.java:73) ← YOUR CODE
wrapped by: OrderConfirmationException("confirmation aborted for order 123") at DemoApp.confirmOrder(DemoApp.java:76)
log: "Failed to confirm order {}" args=[123] logger=i.g.g.s.d.OrderService
mdc: traceId=9f3a userId=42
fields: failedStep=send-confirmation-email orderId=123 retryable=false
story (traceId=9f3a, last 4 events, 433ms):
20:46:01.882 INFO OrderController POST /orders/123/confirm
20:46:02.001 INFO CustomerClient fetching customer 555 → HTTP 404
20:46:02.001 WARN CustomerCache miss for customer 555, returning null
20:46:02.315 ERROR OrderService Failed to confirm order 123 ← this error
stack (distilled, 2 of 2 frames):
DemoApp.confirmOrder(DemoApp.java:73) ← culprit
DemoApp.main(DemoApp.java:61)
env: app=shop-api 1.4.2 (git 7e3c1f) | java 21.0.6 | windows
━━━ END #c73cf755 ━━━