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 -r requirements.txt
pytest

Release files for logstop 0.2.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.2.0
File Size Uploaded
logstop-0.2.0.tar.gz 4.3 kB Details

Built distribution (wheel)

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

Total release size: 7.9 kB

Release files / logstop-0.2.0.tar.gz

Download URL logstop-0.2.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
80b1857e6aa670a3857893f1031c34cb9333ec19b10cbbc3583f84b10f36bbe0
BLAKE2b-256 checksum
How to use checksums
fa9779d64a152aefcc1676abcdd056e7f63f10d3214034a0b730568207797795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.5

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

Download URL logstop-0.2.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
949099f3126cd8893cef63c26cd02ce20976fb5f4111d15848cfb56b26194373
BLAKE2b-256 checksum
How to use checksums
98c924fd94e761b00571d0bcc23f0d8ee79a0df0f1835c037fa7e494dbebe0f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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