Skip to content
Novus Examples
log631 B

Python Traceback (log)

A realistic Python traceback with a chained exception ('During handling of the above exception...') and a caret error indicator. A fixture for testing traceback parsers and error-reporting tools.

Preview — first 15 lineslog
Traceback (most recent call last):
  File "/srv/app/api/views.py", line 96, in create_order
    total = compute_total(cart, customer.discount_rate)
  File "/srv/app/api/pricing.py", line 38, in compute_total
    return subtotal * (1 - rate)
                       ~~~~~~~~^~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/app/api/views.py", line 101, in create_order
    log.error("pricing failed for %s", customer.id)
AttributeError: 'NoneType' object has no attribute 'id'

Specifications

Language
Python
Exception
TypeError -> AttributeError
Chained
true
Frames
4

What is a .log file?

LOG files are plain-text records of events emitted by software, typically one entry per line with a timestamp, severity, and message. There is no single standard, so formats range from unstructured text to structured JSON lines. They are central to debugging, monitoring, and auditing.

How to use this file

Use an example LOG file to test log parsers, timestamp and severity extraction, line-oriented streaming, and ingestion into monitoring or analysis pipelines.

Generated by generation/data_logs.py. Free for any use, no attribution required — license.