Last active
August 3, 2021 02:41
-
-
Save levlaz/5a64059bc57cf172a269dddce14c07e7 to your computer and use it in GitHub Desktop.
Nonsense logs with PII
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logs: | |
- type: file | |
path: "tmp/sample_logger.log" | |
service: "nf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Send Logs to DataDog. | |
This is a utility script that generates fake logs for filling in the DataDog log dashboard. | |
""" | |
import time | |
import logging | |
from faker import Faker | |
fake = Faker() | |
logging.basicConfig(filename='/tmp/sample_logger.log', | |
encoding='utf-8', level=logging.DEBUG) | |
log = logging.getLogger() | |
while True: | |
log.warning(fake.sentence()) | |
log.warning(fake.sentence()) | |
log.warning(fake.sentence()) | |
log.warning(fake.sentence()) | |
log.warning(fake.paragraph()) | |
log.error(f"SSN:{fake.ssn()} and CC:{fake.credit_card_number()}") | |
log.warning(fake.sentence()) | |
log.warning(fake.sentence()) | |
log.warning(fake.sentence()) | |
log.warning(fake.credit_card_number()) | |
log.warning(fake.sentence()) | |
time.sleep(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment