Skip to main content

logsite

PyPI Python CI License: Apache 2.0

Your logs say something broke. logsite tells you which line of your code, and writes a test that proves it.

It reads the logs you already have (a file, Loki, OpenSearch, CloudWatch, Sentry or OpenTelemetry), groups thousands of stack traces into a few causes, and points each one at your line of code. No SDK, nothing to add to your services. Works with Python, Java, Go, TypeScript and JavaScript.

pip install logsite

Try it

The repo has a small demo shop with a planted bug and its production log.

pip install logsite pytest
git clone https://github.com/rajpaynaik/logsite && cd logsite/examples/bookstore

1. What's failing?

$ logsite errors --from ../../bench/repro/scenarios/supplier-timeout/incident.log
28 errors in incident.log · 2 group(s)

  #  TREND  COUNT  ERROR                                      RAISED AT       LOGGED AT
  1            25  TimeoutError: timed out                    supplier.py:31  api.py:36
  2             3  ConnectionRefusedError: cache unavailable  cache.py:15     api.py:23

2. Write a test that reproduces it.

$ logsite repro --from ../../bench/repro/scenarios/supplier-timeout/incident.log --write-test
wrote tests/test_repro_346fa937.py

3. Check it fails the way production did.

$ logsite agent --expect 346fa937 -- python -m pytest tests/test_repro_346fa937.py
✓ 346fa937 reproduced: TimeoutError through bookstore/supplier.py:31, as in production

Fix supplier.py until the test passes.

Use it on your service

cd your-service
logsite errors --from app.log        # errors grouped by cause
logsite lint                         # logging mistakes in your code

To read from your log store, add a logsite.toml:

[backend]
type = "loki"                        # or "opensearch", "cloudwatch", "sentry", "file"
url = "http://localhost:3100"
selector = '{service_name="checkout"}'

Watch production

logsite watch checks your logs every 5 minutes, stores every error in your own database, and posts to Slack when an error is new, back after a fix, or spiking, or a release made errors worse (release health). No SDK: it reads the log store you already have.

Guided setup: logsite init asks for your log store, Slack and database in the terminal, testing each one; logsite app does the same in your browser.

Or with a config file:

[backend]
type = "loki"
url = "http://loki:3100"
selector = '{service_name="checkout"}'

[alerts]
slack_webhook_env = "SLACK_WEBHOOK_URL"   # a Slack incoming webhook

[store]                                   # leave out to use SQLite
url_env = "LOGSITE_DATABASE_URL"          # Postgres, MySQL, SQL Server or ClickHouse
pip install "logsite[postgres]"
logsite watch --dry-run                   # print the Slack messages first
logsite watch

Tables are created on first use. The first check loads the last 24 hours without posting; logsite db backfill --since 30d loads more.

Where to run it: anywhere that can reach your log store: a server, Docker, or Kubernetes. On Kubernetes (EKS included) it's one Deployment with one replica, config in a ConfigMap, secrets in a Secret, and an IAM role for CloudWatch. See Run on Kubernetes.

More

Command What it does
logsite app Set everything up and browse errors in your browser, no terminal needed
logsite db backfill --since 30d Store errors in your own database (SQLite, Postgres, MySQL, SQL Server, ClickHouse) for instant date-range queries
logsite errors -i Browse the stored errors in the terminal: search, any time range, open one, copy it as an AI prompt
logsite prompt <id> --copy Everything about one stored error (code, when it started, the commits before, what failing requests share) as a prompt for your AI assistant
logsite release Did the last release make errors worse? New, back, spiking and fixed errors, with the suspect commits, and a Slack alert when it's bad
logsite investigate Find the deploy and commit behind an incident
logsite grafana --store postgres A Grafana dashboard on your stored errors

Also: a GitHub Action, a VS Code extension, and a Claude connector (MCP) so you can ask "what failed in checkout yesterday after 3pm?" in plain English.

Docs

Commands · Configuration · logsite app · Watch production · Release health · Kubernetes · Reproduce an error · AI prompt · Security · Changelog

Questions and ideas: Discussions. Contributions welcome, see CONTRIBUTING.md.

License

Apache 2.0

Metadata

Release files for logsite 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logsite 0.8.0
File Size Uploaded Provenance Actions
logsite-0.8.0.tar.gz 1.4 MB With provenance Details for logsite-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for logsite 0.8.0
File Interpreter ABI Platform Actions
logsite-0.8.0-py3-none-any.whl Python 3 none any Details for logsite-0.8.0-py3-none-any.whl

Total release size: 1.7 MB

Release files / logsite-0.8.0.tar.gz

Download URL logsite-0.8.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b032fb4210ca22b5ffa33c0076762abf13df1f28772da056651e60e197eef4bb
BLAKE2b-256 checksum
How to use checksums
af57dddcd9a6e9a93b175b00d9abae1a2605d5e4a491b204fbcf202c10a7cd29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / logsite-0.8.0-py3-none-any.whl

Download URL logsite-0.8.0-py3-none-any.whl
Size 291.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fc4b94fc501a68d576fb2f2256712b5d8ab944b107ef55c3ca5e74d431d0d19
BLAKE2b-256 checksum
How to use checksums
7147678ade15cc1e419f071101f47a003152d3ad30838a809fad5262fd310990
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for logsite 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for logsite-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page