1. What is a traceback and how do you make it actionable in logs?
A traceback is the recorded path of function calls that led to an exception. It shows the file, line numbers, and frames, ending at the point of failure. Reading it reveals both the symptom and the path that produced it. In logs, include exception info and context. Capture variables that explain inputs, but avoid leaking secrets. Use logging.exception inside an except block so the traceback is included automatically.
import logging
try:
risky()
except Exception:
logging.exception('risky failed with inputs=%s', args)