Scan your whole stack
Are you using log-foundry?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.3.0
log-foundry was last scanned on 29 Nov 2026 at version 1.3.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.3.0 LATEST | 29 Nov 2026 | No rules fired |
| 1.2.0 | 14 Nov 2026 | No rules fired |
| 1.1.0 | 5 Nov 2026 | No rules fired |
| 1.0.2 | 3 Nov 2026 | Not shown |
Findings for v1.3.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.3.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Consistent, structured (JSON) logs for every decorated function call — correlated by shared trace/span IDs, ready to ship to any of 30-plus built-in sinks (stdout by default; SQS → ELK is the headline production path).
log-foundry owns the logs pillar of observability. You decorate a function with @trace;
it emits one identically-shaped JSON record when the call starts and another when it ends
(with duration and status), stitched together by W3C-compatible trace and span IDs so nested
calls form a tree you can query later.
mypy --strict, ships a PEP 561 py.typed marker.contextvars.@trace never blocks on sink I/O, and a graceful drain at exit means buffered events aren't
lost. Two things you can do deliberately are synchronous:
a level call with no open span, which emits on your own thread, and flush(), which by
definition waits for the drain it asked for.The public API is frozen for the whole of 1.x. Everything in log_foundry.__all__, the
Sink protocol, and every shipped sink class at the import path documented for it below —
together with the public names those signatures use, such as GroupIdSource, DedupIdSource and
Backend — stays put: nothing is removed, renamed or moved, and no signature changes in a way
that breaks a caller, until 2.0.0. The import path is part of that promise because it has to
be — no concrete sink is exported from the top level, so from log_foundry.sinks.sqs import SQSSink is the only way to reach one, and a class pinned at a path free to move is not pinned at
all. 1.0.0 is where they last moved; the upgrade note below says which.
Behaviour is not frozen by that promise — a defect is still a defect, and fixing one can change
what a broken path does. The private half is genuinely private: underscore-prefixed modules —
_lifecycle, _fork, _diag, and the sinks/_*.py helpers — move without notice.
1.0.0 was a reliability release rather than a feature release: three audit arcs worked through
the paths where the library could lose an event, fail its caller, block forever, or report health
it could not back up. If you are coming from any 0.x, read its release notes before you bump —
several of the changes are silent, and they are written against 0.10.1, the release immediately
before this one:
docs/release-notes/v1.0.0.md.
CHANGELOG.md indexes every version.
Published on PyPI as log-foundry:
pip install log-foundry # core, zero dependencies
pip install 'log-foundry[aws]' # + boto3 for the SQS/SNS/Kinesis/Firehose sinks
pip install 'log-foundry>=1,<2' # pin to the frozen API above
Breaking in
1.0.0, if you are upgrading from any0.x. Three public shapes changed once, in the release that froze the API, because none of them could have been changed afterwards without a major version:
health()andsink.losses()return frozen dataclasses, notNamedTuples. Attribute access (h.dropped,losses.failed) is unchanged and is the whole contract;len(h),h[0]and the four-wayqueued, dropped, failed_batches, stopped_reason = health()now raiseTypeError.Healthgains fields, and will gain more — with no positions to preserve, that stops being a breaking change.flush()returns aFlushResultandcontinue_trace()aContinueResult, each truthy or falsy with areasonnaming why.if lf.flush():is unchanged;lf.flush() is Trueis not — the result is an object. A one-bit return could not grow a reason later without silently changing whatif flush():means, which is why it moved before the freeze.SQSSink's injected client is keyword-only (SQSSink(queue_url, client=…)),SentrySinkinjects throughclient=rather than the oldsdkkeyword, with no alias, and the sink attribute the library assigns for interruptible backoff islog_foundry_stop_signal, notstop_signal— a prefixed name cannot silently overwrite one your own sink already uses. Since 1.3.0 that event is its own, one per sink: it is set when a shutdown starts, stays set for a delivery after it, and is cleared whenconfigure()installs it again.Those are the three changes of shape, and not the three most likely to reach you:
log_foundry.sinks.utilwas deleted with no alias — theMemorySink,NullSinkandStderrSinkit held are now atlog_foundry.sinks.memory,…nulland…stdout— and several new construction-time refusals land, all of which rank above two of the three above in the release notes' own ordering. Read the full list of twenty-two before you upgrade —docs/release-notes/v1.0.0.md.
echo,messageandfieldsare reserved parameter names on the emitters; pass fields of those names throughfields={...}, which also takes keys that are not Python identifiers.
Why
log-foundry, when the repository islog-forge. The distribution and the import package match each other —pip install log-foundry, thenimport log_foundry. The project was originally called log-forge, but PyPI rejects that name as too similar to the unrelated, pre-existinglogforgeproject — its similarity check collapses separators, solog-forgeandlogforgecount as the same name. Rather than keep a distribution and an import name that disagreed, everything becamelog-foundry/log_foundryin0.2.0.If you are still on
0.1.x, there is no compatibility shim: migrating is a find-and-replace onlog_forge→log_foundry; no module moved and no public API changed. A handful of emitted defaults carry the name and shift with it:LoggingSink's default logger (logging.getLogger("log_foundry")),SyslogSink(app_name=…),SplunkHECSink(source=…), Datadog'sddsource, and Sentry's client tag. Override them explicitly if a downstream query or dashboard pins the old string.
import log_foundry
print(log_foundry.__version__) # the installed version
To work on the library itself, install from a clone:
# the version is derived from Git tags, so clone with history (not --depth 1)
poetry self add "poetry-dynamic-versioning[plugin]" # one-time, resolves the version locally
poetry install --with dev # or: pip install -e .
The core is dependency-free. Each sink built on a third-party client lives behind its own extra
(the client is imported lazily, only when you construct that sink, and a missing one is refused
with a ModuleNotFoundError naming the extra to install). All other sinks — stdout,
file, SQLite, the stdlib-logging bridge, and every HTTP/socket platform sink (Elasticsearch,
Loki, Logstash, Syslog, Datadog, Splunk, New Relic, Honeycomb) — need no extra.
| Extra | Installs | Enables |
|---|---|---|
aws |
boto3 |
SQSSink, SNSSink, KinesisSink, FirehoseSink |
sentry |
sentry-sdk |
SentrySink via the SDK (a raw-HTTP fallback works without it) |
kafka |
confluent-kafka |
KafkaSink |
redis |
redis |
RedisStreamsSink, RedisListSink |
amqp |
pika |
RabbitMQSink |
nats |
nats-py |
NATSSink |
gcp-pubsub |
google-cloud-pubsub |
GooglePubSubSink |
azure-eventhubs |
azure-eventhub |
AzureEventHubsSink |
mongo |
pymongo |
MongoDBSink |
postgres |
psycopg[binary] |
PostgresSink |
clickhouse |
clickhouse-connect |
ClickHouseSink |
import log_foundry as lf
# Call once at startup. These values are stamped onto every event.
lf.configure(service="billing-api", version="1.4.2", env="prod")
@lf.trace
def charge(order_id: str) -> int:
return compute_tax(order_id)
@lf.trace(name="tax.compute", defaults={"component": "tax"})
def compute_tax(order_id: str) -> int:
return 42
charge("ord_123")
With no sink configured, events are written as JSON lines to stdout. The call above emits
four events — a span.start / span.end pair per function — all sharing one trace_id,
with the child span pointing at its parent via parent_span_id:
{"timestamp": "2026-07-10T00:57:10.411Z", "level": "INFO", "message": "span.start", "trace_id": "8ab2add1480f8f6a52fe97cd23ae6f36", "span_id": "6aeb63c0eba85bf4", "parent_span_id": "b02197e75f40eb81", "log_id": "754adb40e10c445f9ec9e23a2f3dcbf2", "function": "tax.compute", "service": "billing-api", "version": "1.4.2", "env": "prod", "fields": {"component": "tax"}}
{"timestamp": "2026-07-10T00:57:10.411Z", "level": "INFO", "message": "span.end", "trace_id": "8ab2add1480f8f6a52fe97cd23ae6f36", "span_id": "6aeb63c0eba85bf4", "parent_span_id": "b02197e75f40eb81", "log_id": "3af73c51540848afbeaba9fdf7a9dce8", "function": "tax.compute", "service": "billing-api", "version": "1.4.2", "env": "prod", "fields": {"component": "tax"}, "duration_ms": 0.0233328901231289, "status": "ok"}
{"timestamp": "2026-07-10T00:57:10.411Z", "level": "INFO", "message": "span.start", "trace_id": "8ab2add1480f8f6a52fe97cd23ae6f36", "span_id": "b02197e75f40eb81", "parent_span_id": null, "log_id": "e789f7e5268b46d8b779c9cbcdde8656", "function": "charge", "service": "billing-api", "version": "1.4.2", "env": "prod", "fields": {}}
{"timestamp": "2026-07-10T00:57:10.411Z", "level": "INFO", "message": "span.end", "trace_id": "8ab2add1480f8f6a52fe97cd23ae6f36", "span_id": "b02197e75f40eb81", "parent_span_id": null, "log_id": "8f3dbfcfcf4a45f688c738eefef882b0", "function": "charge", "service": "billing-api", "version": "1.4.2", "env": "prod", "fields": {}, "duration_ms": 0.342666869983077, "status": "ok"}
Note on ordering: the child span (
tax.compute) finishes first, so its events flush before the parent's. Correlate bytrace_id/parent_span_id, not by line order.
A traced call travels through a small pipeline. The first four steps run on your own thread and are deliberately fast; the last two run on a background thread so your code never waits on the destination. That is the traced path. A level call with no open span takes the synchronous route instead, described under Flushing and shutdown — and "open" is the operative word: a task that outlives its span still sees that span, but it has closed, so the call takes the synchronous route too.
@trace function, or one of the debug/info/… emitters.span.start, then any events you emit, held in
memory rather than written line by line. While the span is open, the background worker takes
the events you have emitted about once a flush interval (a second by default) and ships them,
so a long-running call's logs do not wait for it to return. span.start stays on the span.span.end event is added
(with duration and status), and what the span still holds, span.start, span.end and any
events logged since the worker last took from it, is handed to the background worker. This
hand-off is instant and never blocks; on an exception the original error is re-raised unchanged.StdoutSink by default, or SQSSink in production.Supporting this path are a handful of single-concept modules: config (the process-wide
service/version/env and the sink), ids (trace/span/log ids), model (assembles the one
JSON shape), context (holds the current span and baggage), and console (the optional
instant echo= line).
Nested calls form a tree through a stack of open spans kept in a contextvars context — the
top of the stack is the "current" span. When a traced function starts, it reads the current
span: if one exists, the new span copies its trace_id and records its span_id as
parent_span_id; if the stack is empty, the new span starts a fresh trace with no parent. The
new span is then pushed, so anything it calls sees it as the parent. On exit the span is
popped by restoring the stack to its exact prior state (via a token, not a blind pop), which
stays correct even when code branches into concurrent tasks. Because the stack lives in a
context variable, every asyncio task gets its own isolated copy — so asyncio.gather children
share their parent's trace, and baggage set in one task never leaks into a sibling. A new thread
gets a fresh context rather than a copy, so nothing follows it there unless the caller copies one
(as asyncio.to_thread does).
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.