Skip to content
Novus Examples
log623 B

Plain-Text Log — ANSI Colour Codes in the Stream (log)

A developer-mode log where the level and service are wrapped in ANSI colour codes, ending with one uncoloured line. Colour codes sit inside the field a parser wants to read, so level extraction fails unless the sequences are stripped first — the classic symptom of a container run without a TTY check.

Preview — first 7 lineslog
2026-03-17T09:14:32.850Z INFO  checkout-api POST /api/checkout started
2026-03-17T09:14:32.856Z DEBUG checkout-api pricing 3 line items
2026-03-17T09:14:32.998Z WARN  checkout-api downstream call took 71ms, budget is 50ms
2026-03-17T09:14:34.921Z ERROR payments-api upstream timed out after 2.0s
2026-03-17T09:14:34.930Z INFO  checkout-api POST /api/checkout completed status=500
2026-03-17T09:14:35.104Z INFO  checkout-api this line carries no colour codes at all

Specifications

Lines
6
Coloured Lines
5
Plain Lines
1
Sgr Sequences
36
Codes Used
0, 1, 2, 31-36, 1;31
Note
SGR colour codes only — no cursor movement

Testing contract

Expected to pass
Scenario
Strip the escape sequences and extract the level from each line.
Expected result
All six lines yield a clean level — INFO, DEBUG, WARN, ERROR, INFO, INFO — where a parser reading the raw bytes matches only the final uncoloured line.

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

“Plain-Text Log — ANSI Colour Codes in the Stream (log)” is a deterministic Novus Examples fixture for Observability, Log parsing, Encoding detection. Structured and plain-text telemetry with known timestamps, levels, request identifiers, and error states for testing log ingestion, correlation, dashboards, and alert pipelines.

Documented properties for this file: LOG · 623 bytes. 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.

Telemetry fixtures use fixed trace IDs, span IDs, and timestamps so ingestion is reproducible run to run. Point your collector, parser, or query layer at the file and assert the documented span tree, metric families, or severity mix; service and host names are invented.

Code examples

grep -i error app-ansi-colour.log | head
awk '{print $1, $2, $NF}' app-ansi-colour.log | head

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