Lesson 23 / 25
Logs, Tracing and Debugging
See what every node did.
Read the run, node by node
Each run is recorded with its inputs, every node's inputs and outputs, the rendered prompts, token usage, timings and errors. Use the editor's step run and single-node testing while building, and logs for production runs. When an answer is wrong, trace backwards: did the classifier route correctly? Did retrieval return the right chunks? Did the prompt render correctly? Did a code node fail? Dify can also send traces to external observability tools for deeper analysis. Dify's node names, menus and options change between versions; check the current Dify documentation.
Run it reliably
Logs, cost awareness and a checklist turn a prototype into a dependable app.
A debugging order
Work from inputs to outputs.
1 inputs: are start variables as expected (types, empty values)?
2 routing: which branch ran, and why?
3 retrieval: which chunks, with which scores?
4 prompts: rendered text correct, variables filled?
5 tools / HTTP / code: status codes, errors, outputs
6 output: end node variables, format
-> save the failing input as a regression testKeep a regression set
Save every input that once failed and re-run the set before each publish.
Quick check: An answer is wrong; what should you check early?
- Whether routing and retrieval behaved as expected
- Only the font of the web app
- The number of API keys
- Nothing; republish
Answer
Whether routing and retrieval behaved as expected — Most failures start upstream of the LLM.