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.
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.
How to use this file for testing
“Python Traceback (log)” is a deterministic Novus Examples fixture for Log parsing, Error handling. Access logs and JSON-lines application logs — for testing log parsers, tailers, and ingestion pipelines.
Documented properties for this file: Python. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Data fixtures document their exact quirks — delimiters, encodings, null handling, schema, and row counts — in the spec table. Point your parser or importer at the file and assert it handles the documented edge cases; clean and deliberately-messy siblings make before/after diffs straightforward.
Code examples
grep -i error stacktrace-python.log | head
awk '{print $1, $2, $NF}' stacktrace-python.log | headRelated files
- logLog Sample — App Json StructuredTiny SAMPLE log excerpt (app-json-structured) for parser and alert-rule tests.

- logLog Sample — Cloudflare Ray SampleTiny SAMPLE log excerpt (cloudflare-ray-sample) for parser and alert-rule tests.

- logLog Sample — Multiline StacktraceTiny SAMPLE log excerpt (multiline-stacktrace) for parser and alert-rule tests.

- logLog Sample — Nginx Access SampleTiny SAMPLE log excerpt (nginx-access-sample) for parser and alert-rule tests.

- logLog Sample — Nginx Error SampleTiny SAMPLE log excerpt (nginx-error-sample) for parser and alert-rule tests.

- logLog Sample — Systemd Journal ExcerptTiny SAMPLE log excerpt (systemd-journal-excerpt) for parser and alert-rule tests.

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