🔥 Keep personal data out of your logs
logger.info('Hi [email protected]!')
# Hi **********!
By default, scrubs:
Works even when data is URL-encoded with plus encoding
Run:
pip install logstop
And add it to your logger:
from logstop import LogstopFilter
logger.addFilter(LogstopFilter())
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
)
View the changelog
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