Skip to main content

Logstop.py

🔥 Keep personal data out of your logs

logger.info('Hi test@example.org!')
# Hi **********!

By default, scrubs:

  • email addresses
  • phone numbers
  • credit card numbers
  • Social Security numbers (SSNs)
  • passwords in URLs

Works even when data is URL-encoded with plus encoding

Build Status

Installation

Run:

pip install logstop

And add it to your logger:

from logstop import LogstopFilter

logger.addFilter(LogstopFilter())

Options

To scrub IP addresses (IPv4), use:

LogstopFilter(ip=True)

To scrub MAC addresses, use:

LogstopFilter(mac=True)

Disable default rules with:

LogstopFilter(
    email=False,
    phone=False,
    credit_card=False,
    ssn=False,
    url_password=False
)

Notes

  • To scrub existing log files, check out scrubadub
  • To scan for unencrypted personal data in your database, check out pdscan

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/logstop.py.git
cd logstop.py
pip install --group dev
pytest

Metadata

Release files for logstop 0.3.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 logstop 0.3.0
File Size Uploaded Provenance Actions
logstop-0.3.0.tar.gz 4.4 kB Without provenance Details for logstop-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 8.0 kB

Release files / logstop-0.3.0.tar.gz

Download URL logstop-0.3.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
df958783b51ddf4f1cfd505aa746523e47fbc6a642648572c239a428131b853c
BLAKE2b-256 checksum
How to use checksums
094a999feccf7bf04533b3a7cb82e37833b02cc3096d1ebb33cc11a6b660bb58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / logstop-0.3.0-py3-none-any.whl

Download URL logstop-0.3.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
698c979327f666680414b2f2587cad022481e3cfda94dbbc9d438d3917b6954f
BLAKE2b-256 checksum
How to use checksums
aceae652a631b30ad4aa21f16c369f038711f0b165a8483b38b75742e77c65aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for logstop 0.3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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