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
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:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
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)
| File | Size | Uploaded | |
|---|---|---|---|
| logstop-0.2.0.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|