Repository navigation
Releases
logwarden v0.11.0
logwarden v0.11.0
Status: Released 2026-11-23 · tag v0.11.0
Outcome: you know which log calls your tests never run. logwarden checks the log lines
that tests write. A log call that no test reaches is never checked, and those are mostly the
calls that matter: errors and exceptions. A prototype on four ai-suite services (2026-11-23)
found that tests run 27% to 50% of the log calls, and almost none on error paths: one service's
tests run none of its 16 error and 4 exception calls, while its line coverage is 64%.
logwarden log-coverage reports, per file and level, which log calls the tests run, from the
coverage data a test run already produces.
What's new
logwarden log-coverage --coverage FILE [PATHS...](Python source). It finds the log
calls in the source (log.info(...),logger.warning(...),self.log.error(...),
logging.exception(...),structlog.get_logger().bind(...).info(...),
logger.log(logging.ERROR, ...)), and counts a call as reached when the coverage data
says the statement that contains it ran.- Coverage data: coverage.py's
.coveragefile,coverage json, or Cobertura XML
(coverage xml,pytest --cov-report=xml). Read without extra dependencies. - A log call is
<receiver>.<level>(...), with leveldebug,info,warning,warn,
error,exception,critical,fatal,msgorlog, and a receiver whose text has
log,logger,logging,structlogorslogas a word (log,self._logger,
app.logger, notdialogorcatalog).--receiver REGEXreplaces that rule. - Not counted: files under
tests/,test_*.py,conftest.py,.venv,venv,
node_modules,build,dist,migrations; lines coverage.py excludes
(# pragma: no cover).--exclude GLOBadds more. A source file missing from the
coverage data counts as not reached.
- Coverage data: coverage.py's
- Emitted, not just reached:
--logs FILE(the lines captured from the tests, e.g. with
LOGWARDEN_CAPTURE) also counts the calls that wrote a log line, bycode.file.pathand
code.line.number. A call can run and write nothing (adebugcall below the log level).
--logsalone, without--coverage, reports emitted calls only. - Output: a summary (reached / total, overall and per level), the files with the most
unreached calls, and the unreached calls aspath:line level receiver;--jsonfor the
full result;--markdown FILEfor a job summary or PR comment. - A CI gate, off by default:
--fail-under PCTexits 1 when fewer than PCT% of the
counted calls are reached (or emitted, with--logs).--levels error,exception,critical
counts only those levels, e.g. "every error path is tested":
logwarden log-coverage --coverage .coverage --levels error,exception,critical --fail-under 80 src/.
Changes you might notice
- A new command. Nothing else changes:
checkand its findings,--jsonkeys, exit codes.
Breaking changes
None.
Later
- Node, Go and Java source (the recipes): needs a parser per language.
- Unreached log calls in the Action's PR comment, as SARIF notes, and in the GitLab template.
Verification
| # | Claim | How it will be checked | Result |
|---|---|---|---|
| 1 | Finds the log calls | Unit fixtures: every receiver form above is found with its level (logger.log(logging.ERROR, ...) as error); warnings.warn, print, dialog.info(), catalog.error(), self.info() are not; a call inside a multi-line statement maps to that statement. On four ai-suite services: the found calls equal a grep for .<level>( minus the non-logger matches, each listed |
✅ tests/test_log_coverage.py::test_claim1_finds_the_log_calls: in the fixture (tests/data/logcov/) exactly the 10 marked calls are found, with log.log(logging.WARNING, ...) as warning, log.exception as exception, logging.error as error; the call inside result = compute(...) maps to the statement's first line; the call under # pragma: no cover is skipped (excluded_by_pragma 1); dialog.info, catalog.error, warnings.warn, obj.info, print are not found. test_claim1_receivers: 15 receivers (9 found, 6 not, incl. blog, logs_dir, self). Four ai-suite services: 44, 55, 35 and 20 calls found; a grep for .<level>( finds the same lines plus one, warnings.warn( (not a log call); nothing found that grep doesn't |
| 2 | Three coverage formats | One fixture project, its tests run under coverage.py: .coverage, coverage json and coverage xml give the same reached calls; a # pragma: no cover log call isn't counted; a file never imported counts as not reached |
✅ test_claim2_three_formats_agree: the fixture run under coverage.py; .coverage, coverage json and coverage xml give identical results (7 of 10 reached: the 7 marked as reached; app/unused.py, never imported, not reached; the pragma call not counted). test_claim2_paths_recorded_elsewhere: the JSON with every path moved under /builds/team/proj/ gives the same 7 |
| 3 | Emitted | The fixture's tests with LOGWARDEN_CAPTURE: --logs marks the calls that wrote a line; a debug call below the log level is reached but not emitted; --logs alone works |
✅ test_claim3_emitted: with the lines the fixture wrote (configure(), LOGWARDEN_CALLSITE=1): 7 reached, 6 wrote a line; the one reached but silent is the marked log.debug (level INFO). --logs alone: 6 emitted, reached and unreached are null |
| 4 | Real services | four ai-suite services: the same numbers as the prototype (one with all its tests passing: 20/55); --markdown and --json agree with the text |
✅ The command on the same coverage data as the prototype, four ai-suite services: 12/44, 20/55, 17/35, 10/20, identical to the prototype, from coverage json and from .coverage. test_claim4_outputs_agree: text, --json and --markdown give the same counts (7 of 10, 70%) and list the same 3 unreached calls; calls equals the sum over levels and over files |
| 5 | Gate | --fail-under exits 1 below and 0 at or above the threshold; --levels limits the count; usage errors (no coverage and no logs, unreadable file, unknown level) exit 2 |
✅ test_claim5_gate_and_levels: no gate: exit 0; --fail-under 70: 0, 71: 1 with "FAIL: 70% reached, required 71%"; --levels error,exception,critical: 4 calls, 2 reached, --fail-under 50: 0, 51: 1. test_claim5_usage_errors: no data, a missing coverage file, a file that isn't coverage data, an unknown level, a bad --receiver, a missing log file: exit 2 with the reason. uv run pytest: 350 passed |
| 6 | Docs, CI, release | docs/log-coverage.md (new page), docs/integration.md, STABILITY.md (command, --json keys), AGENTS.md, docs/roadmap.md (M9), CLI help; CI on Linux, macOS, Windows; dry run to TestPyPI; after the tag, PyPI and the image |
✅ docs/log-coverage.md (new page, in the site navigation), docs/integration.md (section in "Check in CI"), STABILITY.md (log-coverage --json keys), AGENTS.md (logcoverage.py), docs/roadmap.md (M9; the metrics milestones renumbered to v0.12.0 and v0.13.0), CLI help; strict site build passes. PR #20 CI (Linux, macOS, Windows, Python 3.10, coverage, speed, recipes, Docker) passed; main CI 45242112401 after the version bump passed. Dry run and after the tag: see below |
Post-release checks
- ✅ Dry run 45242113816 (before the tag): TestPyPI
0.11.0.dev25, image:0.11.0.dev25. Main CI 45242112401 passed.
logwarden v0.10.3
logwarden v0.10.3
Status: Released 2026-11-23 · tag v0.10.3
Outcome: the GenAI conventions cost no per-run copying. Since v0.10.2 each check builds the
registry chain logwarden → GenAI → semantic conventions by copying about 290 files into a
temporary directory: semconv without the gen-ai, mcp and openai directories that GenAI
replaces (Weaver loads every file under a registry path and can't skip directories), and GenAI
pointed at that copy. Measured on a one-line check (median of 15, laptop): v0.10.1 0.244 s,
v0.10.2 0.355 s, of which about half is that copy and half Weaver loading the larger registry.
Fixes
- The chain is built once and cached next to the downloaded archives
(<cache>/registry-semconv-<v>-genai-<v>-<format>), per pair of pinned versions. It's built in a
temporary directory and renamed into place, so an interrupted or parallel run never leaves a
half-built copy. Each check copies only logwarden's own registry files (a few small files)
and points them at the cached chain. - A cache copied to another directory is rebuilt there. The GenAI manifest in the chain
points at the semconv copy by absolute path (Weaver reads a relative path from the working
directory), so a chain whose path doesn't match its location isn't used. logwarden setupbuilds it too, so the Docker image ships it and runs offline as any user.- When it can't be cached, the check works as before: with
LOGWARDEN_SEMCONVor
LOGWARDEN_SEMCONV_GENAIset (a local directory whose content can change), or when the cache
can't be written (a read-only cache), the chain is built in the run's temporary directory.
Changes you might notice
- A new directory in the cache, about the size of the semantic conventions model.
Breaking changes
None.
Verification
| # | Claim | How it will be checked | Result |
|---|---|---|---|
| 1 | Built once | The first check builds the chain in the cache; a second check doesn't copy semconv or GenAI (the cached chain's files are untouched); the cached chain has no gen-ai, mcp, openai; a check of a GenAI line through the cached chain passes |
✅ tests/test_registry_cache.py::test_claim1_built_once: the first call copies into <cache>/registry-semconv-1.45.0-genai-0.1.0-1, without gen-ai, mcp, openai; the second (base_registry) makes no copytree call, the cached manifest's mtime is unchanged, and the run's directory holds only logwarden/, pointing at the cached chain. test_claim1_checks_use_the_cached_chain: two CLI checks of a line with current gen_ai.* fields: 0 violations, one chain in the cache |
| 2 | Same findings | Full findings for examples/, databridge, yallmp-sync ×2 and the sensitive corpus: identical to v0.10.2; goldens unchanged; claim 8 of v0.10.2 (one definition per field) still passes |
✅ Full findings (rule, level, line, field, message, event) identical to v0.10.2: examples 15, databridge 481, yallmp-sync 3,084 and 3,084, sensitive corpus 1,970. Goldens unchanged. test_genai.py::test_claim8_each_field_is_defined_once (now on the cached chain) passes. uv run pytest: 323 passed |
| 3 | Fallbacks | With LOGWARDEN_SEMCONV / LOGWARDEN_SEMCONV_GENAI set, nothing is written to the cache; with a read-only cache dir, the chain is built in the run's temp dir; a leftover .tmp-<pid> from an interrupted build doesn't get in the way; a cache copied to another directory is rebuilt there |
✅ test_claim3_local_copies_are_not_cached: chain under the run's directory, no registry-* in the cache. test_claim3_read_only_cache (cache dir mode 555): chain in the run's directory, without the replaced directories, nothing written. test_claim3_leftovers_and_a_moved_cache: with a leftover …-1.tmp-99999 the chain is built; after copying the cache to another directory, the chain is rebuilt there and its manifest points at its own semconv (Weaver reads a relative registry_path from the working directory, so it has to be absolute) |
| 4 | Faster | Median of 15 one-line checks vs v0.10.2 on the same laptop: the copy is gone | ✅ Two rounds, laptop under load: v0.10.2 0.655 s / 0.625 s, this change 0.530 s / 0.512 s. Weaver's own time is the same (0.50–0.53 s); the rest went from 0.109–0.127 s to 0.008 s |
| 5 | Setup and image | logwarden setup creates the chain; the image built from this change, run with --network none as uid 12345, checks a GenAI line without writing to the cache |
✅ test_claim5_setup_builds_it: setup creates the chain and says "registry for checks: …". Image built from this change: /opt/logwarden/registry-semconv-1.45.0-genai-0.1.0-1 present (root, a+rX); --network none -u 12345, with a fields file: a line with gen_ai.* fields, a list and 20260911-120000 has no finding, the card number in query_params is found; /opt/logwarden lists the same four entries after the run (not writable by that user). Image removed |
| 6 | Docs, CI, release | AGENTS.md, docs/integration.md (cache contents); CI on Linux, macOS, Windows; dry run to TestPyPI; after the tag, PyPI and the image |
✅ AGENTS.md (check.py row: base_registry, base_chain, CHAIN_FORMAT), docs/integration.md (the cache holds the prepared registry); strict site build passes. PR #19 CI (Linux, macOS, Windows, Python 3.10, coverage, speed, recipes, Docker) passed; main CI 45233549527 after the version bump passed. Dry run and after the tag: see below |
Post-release checks
- ✅ Dry run 45233551756 (before the tag): TestPyPI
0.10.3.dev23, image:0.10.3.dev23. Main CI 45233549527 passed.
logwarden v0.10.2
logwarden v0.10.2
Status: Released 2026-11-23 · tag v0.10.2
Outcome: fixes for bugs found by a user. Following the standard could still fail the check, or lose information:
- Lists. A field declared
type: string[]inlogwarden-fields.yaml, logged as
["a","b"], failed withtype_mismatch("Attribute 'tags' has type 'string'. Type should
be 'string[]'."), so no list field could pass. logwarden gave Weaver every list as JSON text,
typedstring. For the same reasonlogwarden init --fromproposedtype: stringfor list
fields. gen_ai.*fields. The standard (§2) says to loggen_ai.provider.name,
gen_ai.request.modelandgen_ai.usage.input_tokens, andadr_banned_synonymsuggests
gen_ai.request.modelformodel. But each of them failed withdeprecated("Moved to the
OpenTelemetry GenAI semantic conventions repository"). In semantic conventions 1.45.0, which
logwarden bundles, every GenAI field is deprecated because it moved to a separate
repository, not because it was renamed, so the finding names nothing to use instead. A
service that calls an LLM could not pass thestandardprofile.- Source lines missing when logging is set up in
conftest.py. The pytest plugin turns on
code.file.pathandcode.line.number(for--sarif, GitLab Code Quality and "Fix
first" by file and line) by settingLOGWARDEN_CALLSITE=1inpytest_configure. pytest
importsconftest.pybefore that, so aconfigure()at the top ofconftest.pyran
without it: 0 of 106 captured lines had the fields in one service, while another, which set
up logging later during test collection, had them on 569 of 569. init --fromcontradicted the standard on naming. Its comment on a field without dots
said "A bare name: better namespaced (e.g. myservice.auth_source) in the code", while
§2 says a service's own fields are snake_case without dots.- Timestamp ids reported as card numbers.
adr_sensitive_datatook any 13 to 19 digits
starting with 2 to 6, with a space or dash anywhere, that pass the Luhn checksum, so about one
id in ten like20260911-120000orui_draft/20261122-155637-…was "a card number". - A baseline entry hid every secret in its field. A baseline entry matches by rule, field,
logger and event. The workaround for 5 (baseliningquery_paramsonRequest completed)
also hid a real JWT planted in that field on a later line. - Python 3.10 and 3.11 couldn't unpack the GenAI archive (found by CI on this release). The
archive has two symlinks (CLAUDE.md -> AGENTS.md), and without Python 3.12's extraction
filters logwarden rejected any archive with a link: "unsafe path in archive".
Fixes
Lists
- Lists are checked as arrays. A list whose items are all one type goes to Weaver as
string[],int[],double[]orboolean[], with its items. Ints and doubles together are
double[]. A list with mixed items, nulls, lists or objects is still checked as JSON text
(string), as before. This also applies to semconv fields typed as arrays, such as
process.command_args. - An empty list takes the declared type.
[]has no items to go by, so when the field is
declared as an array type, it is checked as that type. Otherwise it stays JSON text. This
costs one extra Weaver call (resolving the registry), only when the input has an empty list. - Secrets inside lists are still found. The sensitive-data rules scanned a list's JSON text.
They now scan each item (strings and whole numbers), one item at a time, so two numbers never
join into a card number. init --fromproposes array types, e.g.type: string[]for a list of strings. Empty
lists don't count when picking the type; a field that was only ever[]isstring[].
GenAI fields
- logwarden bundles the OpenTelemetry GenAI semantic
conventions v0.1.0 (their
first release, built on semantic conventions 1.45.0) next to semantic conventions 1.45.0.
Thegen_ai.*,openai.*,mcp.*,a2a.*andaws.bedrock.*fields they define are
current fields again, with GenAI's types (for examplegen_ai.request.top_kis nowint). - Each field has one definition. Semantic conventions 1.45.0 keeps the moved fields as
deprecated in itsgen-ai,mcpandopenaidirectories. With both registries loaded, Weaver
reports each such field as declared twice and uses one definition or the other depending on
the group order, sogen_ai.tool.nameand themcp.*fields stayed deprecated. logwarden
leaves out the semconv directories that GenAI replaces (those with the same name). - Old GenAI names still say what to use. Names that GenAI v0.1.0 no longer has would
otherwise be reported as unknown (missing_attribute). logwarden's registry declares them as
deprecated, with the new name:gen_ai.system→gen_ai.provider.name,
gen_ai.usage.prompt_tokens→gen_ai.usage.input_tokens,gen_ai.usage.completion_tokens→
gen_ai.usage.output_tokens,gen_ai.usage.cache_creation.input_tokens→
gen_ai.usage.cache_write.input_tokens,gen_ai.workflow.name→gen_ai.agent.name,
gen_ai.openai.request.seed→gen_ai.request.seed,gen_ai.openai.request.response_format→
gen_ai.output.type, the threegen_ai.openai.*service tier and fingerprint fields →
openai.*.gen_ai.token.typeis deprecated without a new name (GenAI replaced it with
separate histograms). - Offline: the GenAI archive is downloaded once with a pinned SHA-256 and cached, like the
semantic conventions;logwarden setupand the Docker image include it. To use your own copy,
setLOGWARDEN_SEMCONV_GENAIto itsmodeldirectory (new environment variable). - The pin update (
update-pins.yml) also looks for new GenAI releases. docs/standard.md: the GenAI note now says logwarden bundles the GenAI conventions, and
thatdeprecatedfindings name the new field when there is one.
Secret findings
- Card numbers need an issuer's prefix and length (Visa 13/16/19 digits, Mastercard 51-55
and 2221-2720, American Express 34/37, Diners Club, Discover, JCB, UnionPay, Maestro) and
card grouping: no separators, groups of 4 (4111 1111 1111 1111, with a last group of up to
3), or 4-6-5 / 4-6-4 (American Express, Diners Club). Then the Luhn checksum, as before.
20260911-120000(14 digits starting 2026, 8-6 grouping) is neither. - Baseline entries for
adr_sensitive_datarecord what was found: a newkindkey
(key,nested,jwt,bearer_token,api_key,private_key,url_credentials,
email,card_number). An entry hides only that kind, so a known card number in a field no
longer hides a JWT there. Entries of other rules are unchanged.--comparewith a snapshot
matches the same way, and the SARIF and Code Quality fingerprints of secret findings include
the kind. - Old secret entries hide nothing. A baseline written before v0.10.2 has no
kindon its
adr_sensitive_dataentries, so it can't say which secret it accepted. Those entries no
longer match. The result counts them in a new--jsonkey,baseline_outdated, and the text
and Markdown output say: "N adr_sensitive_data entries are from before v0.10.2 and no longer
hide anything; check those findings, then run 'logwarden baseline'". They are not counted in
baseline_fixed.
Other fixes
- The pytest plugin sets
LOGWARDEN_CALLSITE=1when it is imported (only while
LOGWARDEN_CAPTUREis set, and not over a value you set). pytest imports plugins installed
with the package before anyconftest.py, so logging set up there gets the source fields. - Archives unpack on Python 3.10 and 3.11: links in a downloaded archive are skipped
instead of failing the download (nothing logwarden reads is a link). Absolute paths and..
are still refused. Python 3.12 and later already used the safe extraction filter. init --fromfollows the standard: the hint is now on dotted names ("Dotted: the
standard (§2) names a service's own fields snake_case without dots; dots are for semconv
names"), and fields without dots get none. The Claude Code skill says the same.
Changes you might notice
-
A list field that was declared
stringto get past the bug now fails withtype_mismatch.
Change it to the array type. -
GenAI fields:
deprecatedfindings on current GenAI fields go away. A field that GenAI
changed can now fail where it passed:gen_ai.request.top_klogged as a decimal
(type_mismatch, nowint), and fields GenAI removed or renamed (deprecatedwith the new
name). Fields from other semconv areas are unchanged. -
A list field in the
essentialprofile: no change (unknown and mistyped fields are outside
essential). -
Fewer
adr_sensitive_datafindings for numbers that only looked like cards: ids and
timestamps with dashes in non-card places, and digit strings with no card issuer's prefix
and length. On the five sample sets (below) no finding changed. -
GitHub code scanning and GitLab Code Quality show existing secret findings once as fixed and
new, because their fingerprint now includes the kind.
Breaking changes
- A baseline with
adr_sensitive_dataentries fails again until it is regenerated: check
the findings it now reports (baseline_outdatedsays how many entries are affected), fix
the real ones, then runlogwarden baseline. This breaks the promise that a baseline from
an older version keeps working, under the security exception now inSTABILITY.md: an old
entry can't tell an accepted value from a leaked secret.
Verification
| # | Claim | How it will be checked | Result |
|---|---|---|---|
| 1 | Declared list fields pass | tags: string[], counts: int[], ratios: double[], flags: boolean[] in a fields file; lines wit... |
logwarden v0.10.1
logwarden v0.10.1
Status: Released 2026-11-22 · tag v0.10.1
Outcome: logwarden passes its own standard, and it's fast enough to check a large log
file in CI. Two gaps found when we reviewed whether the tool is ready for production:
- logwarden's own messages were plain text on stderr, so logwarden failed its own standard. Checked
with logwarden, two download messages gave twoadr_non_json_linefindings, a rule in the
essentialprofile. - A check took about 9 ms per log line (10,000 lines took 89 s), so a CI job with a large test
log took minutes. About 7 ms of that went to logwarden's sensitive-data rules: Weaver's Rego
engine runs each regular expression on every value.
What's new
- JSON messages:
LOGWARDEN_LOG_FORMAT=json(or--log-format json). Every message
logwarden writes to stderr becomes one JSON record that passes the standard, even with the
standardprofile. This includes progress, warnings, errors, invalid arguments, a crash, and
third-party library lines inlogwarden mcp.- Each record has
timestamp,level, a constant snake_caseevent(for example
weaver_download_started,logs_fetched,command_failed),logger,
service.name=logwarden,service.version,deployment.environment.nameand
logwarden_detail, which holds the same text as the plain-text message. - Warnings and errors add
error.type. A crash addsexception.type,exception.messageand
exception.stacktrace. - The environment comes from
DEPLOYMENT_ENVIRONMENTorOTEL_RESOURCE_ATTRIBUTES, as for
configure(). Without either it isproduction. logwarden_detailis declared in logwarden's registry, so a check of logs that include
logwarden's own records needs no fields file.- The records go to stderr, not stdout: stdout carries the result (
--json, the MCP
protocol). Container platforms collect both.
- Each record has
- The Docker image writes JSON messages by default. Its output usually ends up in a log
pipeline. The GitLab template setsLOGWARDEN_LOG_FORMAT: text, so job logs stay readable.
Outside the image, plain text stays the default. - Faster checks. Findings are the same as before; three changes make them cheaper:
- Each sensitive-data rule first looks for text that any match must contain, such as
@for
an email address,eyJfor a JWT, or 13 digits in a row for a card number. The regular
expression runs only when that text is present. - Each distinct field value (name, type, value) is checked once, and so is each distinct line
shape (event, level, whether the trace context is valid, field names). Each line's findings
are put back together from those results. Weaver judges every field on its own, and the
per-line rules read only the shape, so the result is the same. - Large inputs are checked by several Weaver processes in parallel (up to 8), one chunk each.
- Each sensitive-data rule first looks for text that any match must contain, such as
Changes you might notice
- With
-o DIR,samples.jsonandlive_check.jsonhold what Weaver was given: each distinct
field and line shape once, not one sample per line. - With the Docker image, messages on stderr are JSON unless you set
LOGWARDEN_LOG_FORMAT=text. The wording and layout of messages are not part of the public
interface (STABILITY.md), and the GitLab template keeps plain text.
Breaking changes
None.
Verification
| # | Claim | How it will be checked | Result |
|---|---|---|---|
| 1 | JSON messages pass the standard | Self-check test: with LOGWARDEN_LOG_FORMAT=json, collect stderr from check (a run with -o, a missing file), fetch against an unreachable server, an invalid argument, capture with a command, setup, and a crash. Then run logwarden check --profile standard on it: 0 findings, and the records include each expected event. --log-format json works the same. Text mode output is unchanged |
✅ tests/test_selflog.py: with LOGWARDEN_LOG_FORMAT=json, stderr of check -o with a config warning, a missing file, an invalid --profile, fetch against a closed port, setup, capture -- python -c pass (no records), a crash, both download messages and third-party lines (info, warning, exception) is all JSON, has the events config_warning, output_written, command_failed (usage_error, invalid_arguments), semconv_ready, capture_started, capture_finished, command_crashed (with exception.stacktrace), weaver_download_started, semconv_download_started, library_log, and check --profile standard on it reports 0 violations. --log-format json works before and after the command and as --log-format=json; an invalid value exits 2; the environment comes from OTEL_RESOURCE_ATTRIBUTES. Text mode: logwarden: check: no such file: missing.jsonl, as in 0.10.0 |
| 2 | logwarden mcp |
The MCP server in JSON mode: start it, call list_rules over stdio, and stop it. Its stderr, including the MCP library's lines, passes --profile standard, and stdout is only the protocol |
✅ logwarden mcp in JSON mode with an empty cache, driven over stdio (initialize, a malformed line, check_logs): stdout had only the 2 protocol responses; stderr had weaver_download_started and semconv_download_started records, and check --profile standard on it: 2 records, 0 violations. The MCP library wrote nothing to stderr, even for the malformed line, so its routing is covered by the library_log lines of claim 1 |
| 3 | Same findings | The --json result before and after this change, for examples/ (goldens unchanged except the version), the real-service samples of v0.10.0 (databridge, yallmp-sync), and a generated file with secrets, emails, card numbers, JWTs, keys and nested JSON: identical findings, both with one Weaver process and with chunks |
✅ Full findings (rule, level, line, field, message, event) of 0.10.0 recorded before the change, for examples/ (15), databridge (481), yallmp-sync (3,084, two captures) and a generated file of 919 lines with each kind of secret, email, card number (valid, invalid, with spaces and dashes, as numbers), JWT, key prefix, nested JSON and sensitive or harmless key names (2,016): identical after each step (guards; field and shape deduplication; parallel chunks), with one Weaver process and with chunks forced. The generated file is now a test against 0.10.0's findings (tests/test_same_findings.py, both modes). Goldens: only the version changed (make golden, reviewed) |
| 4 | Faster | --profile essential on 1,000, 10,000 and 100,000 generated lines: time before and after on a laptop (8 cores) and on a GitHub Linux runner. Target: 100,000 lines in under 60 s on both |
✅ Before (0.10.0, laptop, 8 cores): 1,000 lines 9.4 s, 10,000 lines 89 s, 200,000 lines not done after 10 min (stopped). After, laptop: 1,000 lines 1.5 s, 10,000 lines 2.0 s, 100,000 lines 14.3 s (scripts/speed.py: 7 fields per line, ids unique). GitHub Linux runner, new CI job speed: 100,000 lines in 13.3 s (run 45040879771). Worst case, every field value unique on every line (trace ids, UUIDs, random numbers; 7 per line), laptop: 100,000 lines in about 70 s, so above 60 s: there is nothing to deduplicate and Weaver's own cost per value remains. Typical logs repeat most values |
| 5 | Image and template | The image built from this change writes JSON to stderr by default, LOGWARDEN_LOG_FORMAT=text restores plain text, and the GitLab template sets text |
✅ Image built from this change (--network none): check missing.jsonl writes a command_failed JSON record and exits 2; with -e LOGWARDEN_LOG_FORMAT=text it writes logwarden: check: no such file: missing.jsonl. The image's own stderr (output_written, command_failed) checked by the image with --profile standard: 0 violations. The GitLab template sets LOGWARDEN_LOG_FORMAT: text in both jobs |
| 6 | Docs, CI, release | STABILITY.md (env var), docs/integration.md, AGENTS.md; CI on Linux, macOS and Windows; dry run to TestPyPI; after the tag, PyPI and the image |
✅ STABILITY.md (env var; event names of the JSON records), docs/integration.md, AGENTS.md (selflog.py, the stderr rule, the speed rules for new Rego rules) updated; strict site build passes; CI run 45040879771 (PR #8: Linux, macOS, Windows, coverage 93%, speed) passed. Dry run and after the tag: see below |
logwarden v0.10.0
logwarden v0.10.0
Status: Released 2026-11-22 · tag v0.10.0
Outcome: a team on the essential profile moves to the full standard in one reviewed
change, without a wall of findings. After v0.9.0 a team starts with the rules every service
should pass. The next step, standard, adds the naming rules, and on an existing service most
of its findings are missing_attribute: custom fields the registry doesn't know yet. This
version turns them into a fields file to review instead of hundreds of findings to read, and
keeps the pinned Weaver and semconv versions current without manual work.
What's new
logwarden init --from LOGSreads real logs (any inputcheckaccepts, including
Elasticsearch and Kibana exports) and writeslogwarden-fields.yamlwith every custom field it
saw, its type and how many lines had it.- Fields that are synonyms of semconv names (
status,user_id, …) or look sensitive are
not declared. They are listed in a comment in the file with the rule that reports them,
so they still get fixed rather than accepted. A field that a rule flags anywhere isn't
declared, even if other lines with it pass. - Types come from the values seen (a field with whole and decimal numbers is
double). Each
field gets aTODOdescription and how many lines had it; no logged value goes in the file.
A field with a bare name (type,result) is marked as better namespaced: on the two
services tried, every new field was a bare name. - Fields written with underscores where semconv has a dotted name aren't declared either
(adr_semconv_prefix). - Running it again on newer logs adds new fields and keeps the existing entries and their
edits. init --fromalso setsprofile = "standard"in the config, so the change that adds the
fields file is the change that turns on the full standard.
- Fields that are synonyms of semconv names (
- "Ready for standard" in the summary. Under
essential, the summary says how many of the
findingsstandardwould add are unknown fields thatinit --fromwould declare, and how
many are other rules: how big the move is, before making it.--jsongets the key
outside_profile_unknown_fields. - Pinned Weaver and semconv versions stay current. A weekly workflow,
update-pins.yml,
looks for new releases. When it finds one, it updates the version and its SHA-256
(scripts/update_pins.py), runs the tests, and opens a PR that says whether they passed. A
repository that doesn't let Actions open PRs (the default for new repositories) gets an
issue with a link that opens the PR instead. A manual run can pin a given version.
Breaking changes
None.
Verification
| # | Claim | How it will be checked | Result |
|---|---|---|---|
| 1 | init --from |
Tests: on a log file with custom fields, synonyms, underscore semconv names and a sensitive-looking field, the fields file declares exactly the custom fields with their types and counts, and lists the others with their rules; check --profile standard with that file reports no missing_attribute and still reports the synonyms; a second run on newer logs adds fields and keeps edits; Elasticsearch and Kibana CSV exports work as input; the file contains no logged value |
|
| 2 | Ready for standard | Under essential, the summary's two counts add up to standard's extra findings, and the unknown-field count equals the number of missing_attribute findings that disappear after init --from |
|
| 3 | On real services | init --from on the logs of two ai-suite services (for example aihub and databridge): the number of standard findings before and after, and the remaining ones each reviewed as worth fixing or not, recorded here |
|
| 4 | Pin updates | Tests of scripts/update_pins.py (rewrites, SHA-256 entry, nothing to do when current). update-pins.yml run manually with older versions as input: it runs the tests and opens a PR (or, where Actions may not open PRs, an issue linking the branch) with the versions and the downloaded SHA-256, saying how the tests went; it is closed unmerged. Run with no input (the latest releases, which are the current pins): no PR |
|
| 5 | Docs, CI, release | The "Start here" pages end with the step to standard; docs/integration.md, README, skill, AGENTS.md, roadmap; CI on Linux, macOS and Windows; dry run to TestPyPI; after the tag, uvx logwarden==0.10.0 init --from from PyPI and the image |
logwarden v0.9.0
logwarden v0.9.0
Status: Released 2026-11-22 · tag v0.9.0
Outcome: a team gets its first useful result in under 10 minutes, without changing its
code. Today a new team chooses between eight use cases and about ten ways to integrate, and its
first run on an existing service is a wall of findings in which the serious ones (secrets in
logs) get lost. Teams also hesitate to depend on a v0.x tool with one maintainer. This version
cuts the choices to one recommended path per platform, starts with the few rules every service
should pass, ranks what to fix first, adds a check of the logs a team already has in
Elasticsearch, and writes down what is stable.
logwarden watch, a long-running consumer of the live stream, was planned here first. It was
dropped (2026-11-22): the only team using logwarden runs it in CI only, with no shared state,
and an hourly scheduled job gives the same view with nothing to operate. It is listed under
"Later" in the roadmap.
What's new
-
Rule profiles.
--profile essential(orprofile = "essential"in the config) checks
only what applies to any service as it is:adr_sensitive_data: secrets and personal data in logs,adr_non_json_line: lines that aren't JSON,adr_missing_required: the required resource fields.
standard, every rule as today, stays the default, so nothing changes for existing users.
Underessentialthe summary says how many more findingsstandardwould report, so the next
step is visible.disableand baselines work with both. -
Ranked fixes. Findings are grouped by what causes them: the source line when the logs
havecode.file.path/code.line.number, else the logger and event. The groups are sorted by
the number of lines they affect. The text summary, Markdown and HTML reports start with
"Fix first": the top groups with their share of all violating lines ("the top 3 places
cause 62% of the lines with violations").--jsongets new keysfix_first,
lines_with_violations,profileandoutside_profile(existing keys don't change). -
logwarden fetchwrites the newest lines of a time window from Elasticsearch
(--es URL --index 'logs-*' --since 1h, at most 10,000, Elasticsearch's default limit;
--querynarrows it down) as a_searchresponse forcheck. Credentials come from
LOGWARDEN_ES_AUTH(ApiKey …,Basic …oruser:password), never from the command line.
When more lines matched than were fetched, every report says it's a sample and of what size. -
check --pushgateway URLpushes the per-service metrics to a Prometheus Pushgateway
(PUT, so each push replaces the group). -
Scheduled check of production logs: results without touching the service. A second hidden
job in the GitLab template,.logwarden-production, for a scheduled pipeline (and the same
two commands as a recipe for cron or a Kubernetes CronJob):- It fetches the last
LOGWARDEN_SINCE(default1h) ofLOGWARDEN_ES_INDEX, with
LOGWARDEN_ES_AUTHfrom a masked CI variable. The fetched logs hold logged values, so they
are kept outside the artifacts and deleted after the check. - It runs
checkon the response with the project's[source]and profile, writes the
Markdown and HTML reports and the snapshot as artifacts, and compares with the previous
scheduled run: new and fixed findings since the last run. The previous snapshot is kept
in the job's cache, so pushes between two runs don't lose the comparison. - With
LOGWARDEN_PUSHGATEWAYset, it pushes the metrics, grouped by project. - It never fails on violations (they are the result, not an error). It fails on a bad
config, an unreachable Elasticsearch or an empty window, so a broken schedule is noticed. - It uses the image and works without internet access, like the merge-request job.
- It fetches the last
-
GitLab template: readable comparison names. The merge-request job saves the target
branch's snapshot as<branch>-snapshot.json(e.g.main-snapshot.json), so the report
says what it compared with. -
Grafana dashboard
integrations/grafana/logwarden.json: the share of lines with
violations per service, violations by rule, and the time of the last push (a stale schedule
shows). The panels use the values of the last push, notrate(), because each push is one
window.
Docs
- Four "Start here" pages, one per path, each with copy-paste steps that end in a first
report, starting with theessentialprofile:- Elasticsearch / Kibana: the scheduled check on logs you already have. No code change.
- GitLab: the template on the logs of your test run.
- GitHub: the Action on the logs of your test run.
- AI agents: the Claude Code plugin, or the
AGENTS.mdsnippet.
- README leads with one sentence and the four paths. The eight use cases and the rest of
the integration guide move under "Advanced" in the site nav. Nothing is removed. STABILITY.md: what is a public interface (rule ids,--jsonkeys, exit codes, config
keys, metric names, CLI options, image tags), how it changes (only additions; a removal is
announced in the release notes, warned about for at least two minor versions and happens only
in a major version), which versions get fixes (the latest minor), that published image tags
are never overwritten, and the conditions for 1.0: at least two teams using logwarden for a
month with no change to the public interface needed.
Fixes and maintenance
- Archive paths on Windows. On Python 3.10 and 3.11 the downloaded Weaver and semconv
archives are checked member by member. A name such as/xorC:/xwasn't seen as absolute
on Windows. Every name is now checked with Windows path rules on every OS. The archives were
already checked against a pinned SHA-256, so no download could have used this. - Test coverage is measured in CI (job
coverage), including the CLI and MCP server that
tests start as subprocesses. Below 85% the job fails. 93% at the time of writing.
Breaking changes
None. The default profile is standard, which checks what every earlier version checked.
Verification
| # | Claim | How it will be checked | Result |
|---|---|---|---|
| 1 | Profiles | Tests: bad.jsonl under essential reports only the three rules, and the summary's "more under standard" count equals the standard total minus the essential total; profile in the config and --profile give the same result, the option wins; disable and a baseline work under both; an unknown profile exits 2; with no profile the findings and counts are those of v0.8.1 (the goldens change only by the new keys and the "Fix first" section, reviewed) |
|
| 2 | Ranked fixes | Tests: findings from one source line, or one logger and event, form one group; groups are sorted by affected lines, and shares add up to the violating lines; fix_first in --json; "Fix first" at the top of text, Markdown and HTML; no logged value in any of them; existing --json keys unchanged |
|
| 3 | Scheduled check | Tests of fetch against a stand-in Elasticsearch: the query (window, size, time field, query string), the auth header for each LOGWARDEN_ES_AUTH form, and clear errors for 401, 404, unreachable, an empty window, a bad --since or --size; the sample note when more lines matched. The template's production script against a local Elasticsearch 8 holding bad.jsonl as Fluent Bit ships it (log wrapped, metadata), offline: the reports show the findings, the sample size and exit 0; a second run compares with the first (0 new · 0 fixed), and after adding a bad line 1 new; an empty window, a wrong password and a stopped Elasticsearch each fail the job with a clear message; no logged value in any artifact |
|
| 4 | Pushgateway and dashboard | The pushed metrics appear in a local Prometheus through a Pushgateway with the same names and values as check --metrics; a second push replaces the first; the Grafana dashboard imported into Grafana shows the panels with data (screenshot) |
|
| 5 | Ten minutes to a first result | Each "Start here" page followed word for word, from a clean machine or project, by someone who didn't write it (a fresh agent session gi... |
logwarden v0.8.1
logwarden v0.8.1
Status: Released 2026-11-22 · tag v0.8.1
GitLab support and clearer docs, from feedback by a team running logwarden on GitLab inside a
network without internet access. On GitHub, findings show up in the pull request through the
Action, SARIF and the PR comment. On GitLab, teams got only downloadable reports. Now findings
appear in the merge request, through GitLab's own Code Quality report.
What's new
--codequality FILEoncheckandlint-codewrites a
GitLab Code Quality report. With
artifacts: reports: codequality, GitLab lists new and resolved findings in the merge
request's Reports tab (every tier). Ultimate also marks them in the diff.- A finding sits on the source line that logged it when the line has
code.file.pathand
code.line.number(as for SARIF), else on its line in the log file. Paths are relative to
the repository (--source-rootstrips a build prefix). - Fingerprints don't contain line numbers, so a finding whose code moved stays the same
finding. Each finding has its own fingerprint, because GitLab merges identical ones. - Severity:
criticalforadr_sensitive_data,majorfor every other rule. - Like every report, it never contains logged values.
- A finding sits on the source line that logged it when the line has
- GitLab CI template
ci/gitlab/logwarden.gitlab-ci.yml:
a hidden.logwardenjob toextends:. It runs the Docker image (setLOGWARDEN_IMAGEto
your registry's copy), compares with the target branch's snapshot, writes the Code Quality
report and the HTML and Markdown reports, and needs no internet access. It reports and doesn't
block:allow_failure: exit_codes: [1]lets violations through, but a broken setup (exit 2)
still fails.
Docs
- Integration guide: the GitLab section uses the image and the template instead of
pip install. - Integration guide: new "Without internet access" section. It explains that the package
install and the first-run Weaver and semconv downloads are separate steps. Options:- the image mirrored into your registry;
logwarden setuprun once where the internet is reachable, then the cache copied;WEAVERandLOGWARDEN_SEMCONVpointing at local copies.
- README and integration guide:
configure()is optional. The checker reads whatever JSON a
service's own logger writes, and the pytest plugin captures through the app's own formatter. - Docs site: release notes of versions not yet released are listed as "(planned)", so
they don't look like releases.
Breaking changes
None.
Verification
| # | Claim | How it will be checked | Result |
|---|---|---|---|
| 1 | Code Quality report | Tests: every entry has the fields GitLab requires (description, check_name, fingerprint, severity from the allowed set, relative location.path, integer location.lines.begin); no BOM; fingerprints unique within a report and unchanged when the code moves; source location from code.*, else the log line; --source-root; baseline and disable respected; empty array when clean; no logged value; lint-code --codequality |
tests/test_codequality.py (7 tests): required fields and types, severities from the allowed set, relative paths without ./, no BOM, unique fingerprints; same fingerprints after the code moved 20 lines; code.* location, absolute path inside the repo made relative, path outside the repo → log line with "logged at …" in the description, --source-root maps it back; baseline, disable, clean run → []; stdin → path logs; 10 entries for bad.jsonl, the same rules as the SARIF results; hunter2 absent; lint-code --codequality on svc.py:4. CI run 44997384190: 258 tests green on Linux (py3.10, 3.13), macOS and Windows (Semgrep test skipped there). ✅ |
| 2 | In a real GitLab | GitLab CE and a runner in Docker, the runner without internet access, the template with the locally built image: on the default branch, then a merge request that adds one bad log call and fixes another. The Reports tab lists exactly one new and one resolved finding; the job passes with violations (allowed failure) and fails on a bad config (exit 2); the Markdown report shows the comparison with the target branch | GitLab CE 19.6.1 (Free) and gitlab-runner 19.6 in Docker. Jobs ran on an internal network that reached GitLab but not GitHub or PyPI (checked from a job container), with pull_policy = never, so only preloaded images could run: the 0.8.1 image under a mirror name and the runner helper. A project with its own JSON logger (no configure()) and the template, used as in the guide. main: pipeline "passed with warnings", the logwarden job an allowed failure (exit 1) with its Code Quality report; nothing downloaded. Merge request fixing A (status), adding B (method) and moving C (uid) down three lines: the Reports tab says "Code Quality scans found 1 new finding and 1 fixed finding", B at app.py:28, A at app.py:16 marked Fixed, C in neither list (screenshot). The job fetched main's snapshot with the job token although main's job had failed (allowed): report.md "1 new · 1 fixed · 1 unchanged". A pipeline with LOGWARDEN_LOGS=nope.jsonl: the job fails with exit 2, "no such file", and the pipeline fails. ✅ |
| 3 | Docs | The integration guide's GitLab job is the template's; the offline options work: logwarden setup with the cache copied to a machine without network, and WEAVER + LOGWARDEN_SEMCONV, both give the same result as online; the docs site lists v0.9.0 and v0.10.0 as "(planned)"; strict build passes |
Guide's GitLab job extends: .logwarden from the template; test_claim2_gitlab_template_shape checks the template (no -o, no pip/uvx, exit_codes: [1], Code Quality report) and test_versions its image tag. Offline, in python:3.11-slim with --network none and the 0.8.1 wheel: the cache prepared by LOGWARDEN_CACHE=… logwarden setup → bad.jsonl 10 violations; WEAVER + LOGWARDEN_SEMCONV with an empty cache → 10 violations; nothing prepared → exit 2, "weaver download failed". The template's script under sh and bash, offline, against a stand-in for GitLab's artifacts API that requires the job token: default branch → no comparison, exit 0; merge request into feature/base → fetches the snapshot (branch and job name URL-encoded), report.md shows "10 new · 0 fixed", 10 Code Quality entries, exit 1; target without a snapshot (404) → runs without comparison, exit 1; missing logs file → exit 2. Strict site build passes; the nav shows v0.10.0, v0.9.0 and v0.8.1 as "(planned)". ✅ |
| 4 | Release | CI on Linux, macOS and Windows; dry run to TestPyPI; after the tag, uvx logwarden==0.8.1 check --codequality from PyPI and the image :0.8.1 |
CI 44999836149 green on Linux, macOS and Windows; dry run 44999844540 published 0.8.1.dev13 to TestPyPI and the image :0.8.1.dev13, which (offline, --user 4242) writes a Code Quality report for bad.jsonl: 10 entries, severities critical and major. ✅ |
logwarden v0.8.0
logwarden v0.8.0
Status: Released 2026-11-20 · tag v0.8.0.
Findings on the source line, and analysis of the logs already in Kibana. SARIF puts each
finding on the log.info(...) call in the PR diff. check reads Kibana and Elasticsearch
exports directly, unwraps what Fluent Bit added to each record, and breaks the result down
by service.
What's new
-
Findings on the source line: SARIF.
lint-code --sarif FILEwrites Semgrep's findings as SARIF 2.1.0.check --sarif FILEdoes the same for runtime findings, when log lines say where they were
logged:code.file.path,code.line.numberandcode.function.name(semconv 1.45).
logwarden.logging.configure(callsite=True)adds these fields, and the pytest plugin turns
this on during tests. The Go recipe gets them from slog'sAddSource. A finding without a
location is attached to its line in the log file, so it isn't lost.--source-root
removes a path prefix, so locations match the repository.- Each SARIF rule links to its section of
docs/rules.mdat this version. - The GitHub Action gets a new input,
sarif: "true"(default"false"). It uploads the
check's SARIF withgithub/codeql-action/upload-sarif, which needs
security-events: write; without it, the upload warns and the check still decides the
job. Code scanning then shows each finding on the log call in the PR diff. Code scanning
is available on public repositories, and on private ones with GitHub Advanced Security.
The Action doesn't runlint-code;docs/integration.mdshows the two steps that upload
its SARIF.
-
Kibana and Elasticsearch exports as input.
check,baseline,catalogand
--snapshot/--compareaccept these exports as well as JSON lines. The format is detected
automatically, or set with--format:csv: a Kibana Discover CSV report. Each row is one record, and each column is a field.- When a
_source,logormessagecolumn holds the whole JSON line, that line is used.
Withmessage_fieldset (Fluent Bit'slog), a cell that isn't JSON is a non-JSON line. - Kibana's
-for missing values and its.keywordcopies of text fields are dropped. - CSV loses value types, so values are converted back using the field's type in the
registry (int, double, boolean). An empty cell means the field is missing. - When the export leaves out columns, the required-field rules aren't applied to the
missing columns, because those fields may exist but weren't exported. The output names
the missing columns and suggests exporting all fields. (Kibana 8 exports a_source
column as-, so "all fields" is the way to get whole records.)
- When a
es: an Elasticsearch_searchresponse, as saved from Kibana Dev Tools orcurl.
Records come fromhits.hits[]._source. The file can hold one response or several
scroll pages, as a JSON array or one response per line.jsonl: one document per line (the bare document, or an object with_source), as
written byelasticdumpand similar tools.
Findings refer to the row or hit number instead of the line number, and the Elasticsearch
_idis kept when the export has it.docs/integration.mdshows how to export a time
window from Kibana Discover and with_search. -
Records wrapped by Fluent Bit:
[source]. Fluent Bit adds its own fields, and often
keeps the service's line as a string inlog. With the Kubernetes filter'sMerge_Log On,
it puts the fields at the top level, or underMerge_Log_Key. A new config section
handles all three cases:[source] message_field = "log" # parse the service's JSON from this field (string or object) ignore_fields = ["@timestamp", "kubernetes", "stream", "time", "_p"] # added by Fluent Bit
Fields that Fluent Bit added are then not reported as unknown fields.
--message-field
and--ignore-fieldset the same options on the command line. -
Metrics per service. A Kibana export usually covers many services, so
checknow
breaks its result down byservice.name(or the field set inservice_field):- for each service: the lines, the lines with a violation, a compliance percentage
(lines without a violation), the violations by rule and the most frequent rule; --jsongains aserviceskey;- the text output, the HTML report and the Markdown summary get a "By service" table;
--service NAME(repeatable) checks only those services;--metrics FILEwrites the same numbers in Prometheus text format, for a Pushgateway or
the node_exporter textfile collector. The metric names arelogwarden_lines_total,
logwarden_violations_totalandlogwarden_lines_with_violations_total, labelled by
service, and byrulefor violations.watchin v0.9.0 will use the same names.
Lines without a service are grouped as
(none). Logged values never appear, only the
service names. - for each service: the lines, the lines with a violation, a compliance percentage
-
pre-commit hook.
.pre-commit-hooks.yamlprovideslogwarden-lint-code, which runs
lint-codeon the staged Python, Go, JavaScript/TypeScript and Java files. Semgrep stays out
of logwarden's dependencies: the hook finds it the waylint-codedoes, on PATH or with uvx.- repo: https://github.com/Ingeniator/logwarden rev: v0.8.0 hooks: - id: logwarden-lint-code
Breaking changes
None. --sarif, --format, [source], --metrics, the services and input keys, the
service (and, for exports, id) key of each finding, and the Action's sarif input are
all additions. The text output, the HTML report and the Markdown summary gain a "By service"
table when there is more than one service or a named one (the goldens changed for that and
for the new keys). JSON-lines input is detected as before, so existing commands
behave the same. configure() adds the callsite fields only with callsite=True. In tests the
pytest plugin turns it on, and the fields are semconv names, so existing checks keep passing.
Upgrading from v0.7.0
- For PR annotations: add
callsite=Truetoconfigure(), then setsarif: "true"and
security-events: writein the workflow. - To analyse production logs: export from Kibana (CSV with all fields, or
_searchJSON), add
a[source]section that matches your Fluent Bit output, and run
logwarden check export.csv --html report.html.
Verification
CI run 44683194633 (commit 359a506):
193 tests passed on ubuntu py3.10, ubuntu py3.13 and macos py3.13; on windows py3.13 188 passed
and 5 were skipped (the POSIX and Semgrep tests, as before, plus lint-code --sarif, which needs
Semgrep). The action, review, sarif, package, plugin, recipes and docker jobs passed.
| # | Claim | How it was checked | Result |
|---|---|---|---|
| 1 | SARIF | tests/test_sarif.py: check --sarif and lint-code --sarif validate against the SARIF 2.1.0 schema (tests/data/sarif-schema-2.1.0.json, jsonschema); runtime findings point at code.file.path:code.line.number (relative, absolute under cwd, and a /build/svc prefix removed with --source-root); a finding without a location points at its line in the log file; rule helpUris go to docs/rules.md#<rule> at this version; a clean run and a baselined run give no results; fingerprints don't change when the code moves. configure(callsite=True) writes the 3 fields (also for stdlib loggers, and with LOGWARDEN_CALLSITE=1), and they pass check; the pytest plugin turns them on while capturing. The Go recipe's output (examples/recipes/check.sh go) has the fields and passes. Throwaway PR #2 (closed, not merged) with the CI sarif job (sarif: "true"): it moved the known call on tests/data/sarif_demo/orders.py down a line and added log.info("Shipping order now", http_route=...). Code scanning's check said "2 new alerts in code changed by this pull request", with both annotations on line 15, the added call; the moved call kept alert #5 from main (screenshot of the diff). Found and fixed while checking: the first fingerprints included the line number, and upload-sarif's own primaryLocationLineHash changed with nearby edits, so an unchanged call showed up as new; both are now line-independent. Not done by the Action: lint-code; its SARIF is uploaded with the two steps in docs/integration.md |
✅ |
| 2 | Kibana and Elasticsearch exports | Real exports in tests/data/exports/ (README there): Fluent Bit 3.1.9 shipped bad.jsonl to Elasticsearch 8.15.3 twice (line in log, and json parser), then: a _search response, two scroll pages one per line, elasticdump NDJSON, and Kibana 8.15.3 CSV reports (reporting API) of both indices with all fields. Each gives exactly bad.jsonl's rule counts (10 violations) with [source] options (test_claim2_3_real_exports_give_the_bare_counts). A CSV with hand-picked columns and no log loses the plain-text line, as it should. Synthetic tests: _source CSV, column CSV, a response, pages as an array and as NDJSON, dumps; types come back ("200", '-1, "1,234"); a CSV without service.version names the column and doesn't report it; --format overrides detection; a bad export or format → exit 2; findings carry the hit number and _id (line 3 (id2)); baseline, catalog and --compare accept exports. Found and fixed with the real exports: Kibana 8 writes - for missing values, adds .keyword columns, and exports a _source column as - (docs now say to export all fields); a non-JSON log cell made every column count as missing |
✅ |
| 3 | Fluent Bit [source] |
test_claim3_*: records with the line as a string in log, merged at the top level (Merge_Log), and under log_processed, each with Kubernetes metadata, give the same findings (line, rule, field) as the bare lines; the plain-text `l... |
logwarden v0.7.0
logwarden v0.7.0
Status: Released 2026-11-19 · tag v0.7.0.
Review: show what a change does to the logs. Compare a run with the base branch, read the
result as an HTML report or a pull-request comment, and keep a catalog of the events a
service emits.
What's new
-
Snapshots and comparison with the base branch.
logwarden check logs.jsonl --snapshot base.json # on main: save what this run found logwarden check logs.jsonl --compare base.json # on a branch: what's new, what's fixed
- A snapshot records each finding and each event name seen, with counts. Findings are
matched by the same key as the baseline (rule, field, logger, event), not by line
number, so a moved line isn't "new". --compareadds acomparekey to the--jsonresult:
{base, new, fixed, unchanged, new_findings, fixed_entries, new_events, gone_events}.
The text output gets one line:compared with base.json: 2 new, 1 fixed.--comparealso accepts a baseline file, since both list findings the same way.--compareonly reports. The exit code still comes from the violations afterdisable
and the baseline. To fail only on new findings, use the baseline, as before.
- A snapshot records each finding and each event name seen, with counts. Findings are
-
HTML report:
check --html report.html. One self-contained file (no scripts, no
external CSS or fonts) that works offline and as a CI artifact. It contains:- the totals;
- the comparison, when there is one;
- one section per rule with its title, fix hint and a link to
docs/rules.mdat this
version; - every finding with its line number;
- the event catalog of the run.
It uses light and dark themes. Everything is HTML-escaped, and like the text output it
never shows logged values, only messages, which never contain them.-o DIRnow also
writesreport.html,report.mdandsnapshot.json. -
Markdown summary and PR comment.
check --markdown FILEwrites a short summary:- status and counts;
- new and fixed findings when comparing;
- a table by rule with fix hints;
- the first new findings;
- new event names.
It stays under GitHub's comment size limit. The GitHub Action uses it:
permissions: contents: read pull-requests: write # only for comment: "true" steps: - uses: Ingeniator/logwarden@v0.7.0 with: logs: logs.jsonl comment: "true" # one comment per PR, updated on each push
New Action inputs, each with a default that keeps the current behaviour:
-
compare(defaultauto). On a push, the Action saves the run's snapshot to the
Actions cache. On a pull request, it restores the base branch's latest snapshot and
compares with it. GitHub lets a pull request read the base branch's cache, so no
artifact juggling or extra tokens are needed. It can also be a snapshot path, or
"false"to turn comparing off. -
comment(default"false"). Posts the Markdown summary as a single comment and
updates it on later pushes. It finds that comment by a hidden marker. Without write
permission (pull requests from forks), it prints a warning instead of failing the step. -
upload(default"true"). Uploadslogwarden.report/(HTML, Markdown, JSON,
snapshot) as the artifactlogwarden-report. -
snapshot-id(default: the job id) andartifact-name(default
logwarden-report). Set these when a job checks several log files, so their snapshots
and artifacts stay separate. -
token(defaultgithub.token), used for the comment.
The job summary now shows the Markdown summary instead of the plain text. New outputs:
violations,newandfixed. The step's exit code is decided in a last step, so the
comment and the upload also happen when the check fails.On other CI systems,
--snapshot,--compare,--markdownand--htmlwork the same
way (docs/integration.mdshows GitLab). -
Event catalog.
-
logwarden catalog logs.jsonllists every event name in a run. For each one it
shows the count, levels, loggers and fields, and the first line where it appears.
Use--jsonfor machine-readable output and--markdownfor docs. -
catalog logs.jsonl -o logwarden-events.tomlwrites a catalog file to commit and
describe:[events.order_imported] description = "An order file was parsed and stored." levels = ["info"]
Running it again adds new events and keeps existing descriptions. Events that a run
didn't produce are kept too, because one run rarely covers every path. -
New rule
adr_event_catalog(§4). Withevents = "logwarden-events.toml"in the
config,checkreports each event that isn't in the catalog. It runs only when a
catalog is configured, likeupstreams. Event names then stay a reviewed list, so
dashboards and alerts that match on them don't silently break. -
The catalog is TOML, so it needs no new dependency: Python 3.11+ reads it natively,
andtomlialready covers 3.10.
-
Breaking changes
None. The new --json key and the Action inputs are additions, and exit codes don't
change. The core install still has no dependencies besides tomli on Python 3.10.
Upgrading from v0.6.0
Bump uses: Ingeniator/logwarden@v0.7.0. Comparison starts working once one push to the
base branch has saved a snapshot. Add comment: "true" and pull-requests: write for the
PR comment. To start a catalog, run logwarden catalog logs.jsonl -o logwarden-events.toml,
fill in the descriptions, then set events = "logwarden-events.toml".
Verification
CI run 44599357676 (commit 4374f0e):
174 tests passed on ubuntu py3.10, ubuntu py3.13 and macos py3.13; on windows py3.13 170
passed and 4 were skipped (the same POSIX and Semgrep tests as in v0.6.0). The action,
review, package, plugin, recipes and docker jobs passed.
| # | Claim | How it was checked | Result |
|---|---|---|---|
| 1 | Snapshot and compare | test_claim1_new_fixed_unchanged: a base with A (banned synonym) and B (bad event name) and a run with B (moved from line 3 to 1) and C (secret) give exactly 1 new (C, line 3), 1 fixed (A) and 1 unchanged (B); new event c_done, gone a_done; the text line compared with base.json: 1 new, 1 fixed, 1 unchanged; exit code and result identical to a run without --compare apart from the compare key. test_claim1_disable_and_baseline_file: a disabled rule isn't counted; a baseline file works as --compare (events null). test_claim1_bad_compare_file: missing, empty, non-JSON, incomplete entry and bad events → exit 2 |
✅ |
| 2 | HTML report | test_claim2_html_report: bad.jsonl → every rule and a row per finding, parses as HTML, no script/link/img tags, every link goes to github.com/Ingeniator/logwarden/blob/, no comparison section without --compare. test_claim2_escaping_and_compare_section: an event <script>alert(1)</script> and a field x<b> with an <img onerror> value come out escaped in the HTML and the Markdown. test_claim2_o_dir_writes_reports. Rendered in Chrome: light and dark themes, and at 360px wide the page doesn't scroll sideways (tables scroll inside their box). Rule ids in table cells no longer break mid-word, and the message column keeps a minimum width; both fixed after the first render |
✅ |
| 3 | Markdown summary | test_claim3_markdown_golden: bad.jsonl compared with good.jsonl's snapshot matches tests/golden/bad-vs-good.md (new golden, make golden). test_claim3_markdown_fits_a_comment: 10,000 findings, 200 rules and long names → at most 60,000 characters with "more new findings"; with a 2,000-character limit it is cut with a note |
✅ |
| 4 | Action: compare through the cache, PR comment | Throwaway PR #1 (closed, not merged). tests/data/review.jsonl on main has one known finding; the review job on main saved logwarden-snapshot-review-main-44594795688-1. Push 1 added a line with event Order Imported: run 44596340446 restored that cache entry and posted comment 7019522053: 1 new (adr_event_name, line 3), 0 fixed, 1 unchanged, new event Order Imported. The artifact logwarden-report had report.html, report.md, result.json, snapshot.json. Push 2 fixed both lines: run 44597752545 updated the same comment (id 7019522053): 0 new, 1 fixed (adr_banned_synonym/status), no violations. review-readonly (pull-requests: read, comment: "true") got HTTP 403, logged the warning and passed. The action job (defaults on good.jsonl, plus bad.jsonl with fail: "false" and failing) passed as before, with outputs violations 0 and 10. The job summary gets report.md. This was checked by running the step script locally with a fake GITHUB_STEP_SUMMARY, for push, for a pull request and for a pull request with no base snapshot (a notice); it wasn't read back from the GitHub UI |
✅ |
| 5 | Event catalog | test_claim5_catalog_lists_events: catalog examples/good.jsonl --json gives exactly the 2 expected events (count, levels, loggers, fields, first line); text and Markdown output. test_claim5_catalog_file_merges: -o writes TOML that reads back; a second run keeps a hand-written description and an extra key, keeps an event the run didn't produce, adds a level and a new event with a name that needs quoting. test_claim5_broken_catalog_file → exit 2 |
✅ |
| 6 | Rule adr_event_catalog |
test_claim6_event_not_in_catalog: with events = "ev.toml" an unlisted event gives 1 violation on its line, and a non-snake_case event isn't reported twice; without the config the rule doesn't run; baseline and disable apply. test_claim6_bad_catalog_config: missing file, broken... |
logwarden v0.6.0
logwarden v0.6.0
Status: Released 2026-11-19 · tag v0.6.0.
Any language: check services written in Node, Go, Java or anything with an OpenTelemetry
SDK, run logwarden without Python, and catch problems in source before anything runs.
What's new
-
logwarden capture: receive logs over OTLP. A small OTLP/HTTP receiver (port 4318,
protobuf and JSON encodings, no extra dependencies). Each OTLP log record becomes one line
in the standard's shape: resource attributes (service.name, …) merged in,eventfrom
the record's event name or string body,levelfrom the severity,loggerfrom the
instrumentation scope, W3Ctrace_id/span_id, attributes as fields. The lines go
through the samecheck(baseline,disable,upstreamsall apply).logwarden capture -o logs.jsonl -- npm test # runs the command with OTEL_* pointing at the receiver, then checks logwarden capture -o logs.jsonl # or receive until Ctrl-C / SIGTERM
With a command, it listens on a free port, sets
OTEL_EXPORTER_OTLP_ENDPOINT,
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf(an existinghttp/jsonis kept) and
OTEL_LOGS_EXPORTER=otlp, runs it, then runscheckon what arrived. The exit code is
the command's if it failed, otherwise the check's; no records at all is a setup error
(exit 2). The command's stdout goes to stderr, so--jsonstays parseable. Requests may
be gzip/deflate-compressed or chunked; traces and metrics sent to the same endpoint are
accepted and ignored. Attributes with an empty OTLP value are left out, and a non-string
body next to an event name goes tolog.record.original.--host 0.0.0.0for containers.
(The roadmap said Weaver's live-check receiver. Weaver judges OTLP records directly but
returns no lines, so the baseline, line numbers and upstream coverage wouldn't work there.
gRPC isn't supported; SDKs default to it in some languages, so set the protocol to
http/protobuf, whichcapture -- cmddoes.) -
Docker image
ghcr.io/ingeniator/logwarden:0.6.0(and:latest), linux/amd64 and
linux/arm64, with Weaver and the semantic conventions inside, so it works offline:docker run --rm -v "$PWD:/work" ghcr.io/ingeniator/logwarden:0.6.0 check logs.jsonlIt runs as any user (
--user $(id -u)), with the cache read-only. -
Setup recipes for Node (pino), Go (
log/slog) and Java (logback +
logstash-logback-encoder) indocs/recipes/, each with a runnable example in
examples/recipes/whose output passes the check. The Node recipe also shows the
OTLP route throughlogwarden capture. -
Source checks:
logwarden lint-code [PATHS]runs Semgrep with
logwarden's rules (_data/semgrep/logwarden.yml) for Python, JavaScript/TypeScript, Go
and Java. Semgrep needs one rule per language, so each check has four ids with a
-python,-js,-goor-javasuffix (16 rules):logwarden-event-name-*(§4): a formatted log message (f-string,%,.format,+,
template literal,fmt.Sprintf,String.format) or a literal one that isn't
snake_case ("Imported rows", SLF4J"Imported {} rows"), as the runtime
adr_event_namerule would report it.logwarden-sensitive-key-*(§8): a field named likepassword/token/api_key.logwarden-banned-key-*(§2): a banned synonym as a field name (same list as the
runtime rule).logwarden-print-*(§1, warning):printto stdout,console.log,fmt.Println,
System.out.println,printStackTrace()instead of the logger; test files,scripts/,
cmd/andcli.pyare skipped.
--json,--exclude-rule ID(repeatable) and--list. Semgrep isn't a dependency: it
pins old OpenTelemetry andmcpversions that would clash with a project's (and with
logwarden[mcp]), so there is no[lint]extra.lint-codeusessemgrepfromPATH,
or runs a pinned Semgrep withuvxwhen uv is installed. Semgrep doesn't run natively on
Windows. Like Semgrep, it skipstests/directories. Exit codes as forcheck: 0 clean,
1 findings, 2 setup error.
Fixes
- A read-only cache broke every check.
logwardenmade the cached Weaver binary
executable on each run, which fails when the cache belongs to another user (found by
running the Docker image as non-root). It now only does so when needed. logwarden setupalso downloads the semantic conventions, so a machine (or image) can be
prepared for offline use in one step.
Breaking changes
None. The core install still has no dependencies besides tomli on Python 3.10.
Upgrading from v0.5.0
Nothing to change. For other languages, follow docs/recipes/, then either write JSON
lines to a file and run check, or wrap the test command in logwarden capture -- ....
CI: uses: Ingeniator/logwarden@v0.6.0, or the Docker image.
Verification
CI run 44474028330 (commit 54d3055): 155 tests passed on ubuntu py3.10, ubuntu py3.13 and
macos py3.13; on windows py3.13 151 passed and 4 were skipped (POSIX signal/permission tests,
and the two Semgrep runs: Semgrep has no Windows build). The action, package, plugin,
recipes and docker jobs passed.
| # | Claim | How it was checked | Result |
|---|---|---|---|
| 1 | OTLP protobuf and JSON are received and converted | test_claim1_python_sdk_protobuf: the Python OTel SDK's http/protobuf exporter sends 2 records; the lines have service.*, event, level, logger, a 32/16-hex trace_id/span_id, server.address, exception.type, and pass check with 0 violations. OTLP/JSON from a real SDK: Node's @opentelemetry/exporter-logs-otlp-http (chunked) in the recipe (claim 6). test_claim1_json_encoding: a hand-built OTLP/JSON request with every value type converts to exactly the expected line |
✅ |
| 2 | Conversion details | test_claim2_*: severity numbers 1–24 and 0 map to debug/info/warning/error/critical/info; severity text wins (WARN→warning, TRACE→debug, Information→info, FATAL); unknown text falls back to the number; int (negative), bool, double, bytes (base64), array and map values; event name vs string body (body kept as log.record.original); map body → fields with its event; non-string body; all-zero trace id omitted; observed time used when time is unset; empty values left out |
✅ |
| 3 | capture -- cmd |
test_claim3_*: good logs → exit 0, bad → exit 1 with exactly adr_banned_synonym, adr_environment_value, adr_event_name; a command exiting 7 → 7; missing command → 2; no records → 2 (--no-check → 0); a command printing to stdout leaves --json stdout empty; gzip via OTEL_EXPORTER_OTLP_COMPRESSION, deflate and chunked requests accepted; unknown path 404, broken protobuf/JSON 400, traces/metrics 200 |
✅ |
| 4 | Receive until a signal | test_claim4_until_sigterm (POSIX): background capture --port 0, 2 records sent, SIGTERM → exit 0, both lines in the file, check ran with 0 violations. In the container: docker stop → exit 0, "captured 2 log records", 0 violations (CI docker job) |
✅ |
| 5 | Docker image | CI docker job: the linux/amd64 and linux/arm64 builds each downloaded their Weaver and ran a check in the image (1 records, 0 violations); --network none: bad.jsonl → exit 1 with 10 violations, good.jsonl → 0, also with --user 12345; capture --host 0.0.0.0 in the container received the host's logs. Dry run pushed ghcr.io/ingeniator/logwarden:0.6.0.dev7 (manifest: amd64, arm64), pulled anonymously and run natively on arm64: version 0.6.0.dev7, bad.jsonl 10 violations, good.jsonl clean offline as --user 4242 |
✅ |
| 6 | Node recipe | CI recipes job (examples/recipes/check.sh): pino stdout → 3 records, 0 violations; OTLP via instrumentation-pino through logwarden capture -- node --require ./otel.js app.js → captured 3 records, 0 violations |
✅ |
| 7 | Go recipe | CI recipes job: go run . (slog, Go 1.23) → 3 records, 0 violations |
✅ |
| 8 | Java recipe | CI recipes job: mvn compile exec:java (logback 1.6.7, logstash-logback-encoder 9.0, Temurin 21) → 3 records, 0 violations |
✅ |
| 9 | Semgrep rules | test_claim9_semgrep_test: semgrep --test → "16/16: ✓ All tests passed"; test_claim9_every_rule_has_fixtures: each of the 16 rules has ruleid: and ok: lines; banned-key regex equals the Rego banned set; the sensitive-key regex agrees with patterns.is_sensitive_key on 15 names |
✅ |
| 10 | lint-code |
test_claim10_*: fixtures → exit 1 with exactly the 37 annotated findings, each with the source line; recipes and src/logwarden → 0 findings (also the CI recipes job); --exclude-rule of all four Python rules → 0; unknown --exclude-rule → 2; --list → 16 ids; unrunnable Semgrep → 2 with the install hint; uvx fallback when Semgrep isn't installed (CI ran Semgrep this way). TestPyPI 0.6.0.dev7 with uvx in a clean environment: 37 findings on the fixtures |
✅ |
| 11 | Docs and wiring | docs/recipes/{node,go,java}.md; docs/integration.md (Docker, recipes, OTLP capture, lint-code); README; skill and AGENTS.snippet.md (lint-code, capture); AGENTS.md (layout, commands, Semgrep constraints, image release); roadmap M4 marked done; test_docs_name_this_version checks the @v, == and image tags |
✅ |
| 12 | CI green; release publishes PyPI and the image | CI above. Dry run: release run 44475098046 published 0.6.0.dev7 to TestPyPI and pushed the image; from TestPyPI in a clean environment capture -- <python OTel app> → 2 records, 0 violations. Real publish: checked after the tag |
✅ dry run · ⏳ PyPI and image |