Simple log generator tool with configurable volume and format. Goal is to use this for testing docker log parsing (with stack trace) by different log shipper tools.
Options can be provided by flags or environment variables:
SLEEP_INTERVAL_SECenv variable or-s / --sleep-intervalas command argument: Sleep interval between log generation events in seconds. (default:10)REPEAT_MESSAGES_BETWEEN_SLEEPSenv variable or-t / --timesas command argument: Repeat messages number between sleeps. (default:1)JSON_FORMATenv variable or-j / --json-formatas command argument: Boolean flag to enable json formatted logging. (default:false)DOCKER_FORMATenv variable or-d / --docker-formatas command argument: Boolean flag to enable docker formatted logging. (default:false)BROKEN_JSONenv variable or-b / --use-broken-jsonas command argument: Boolean flag to enable json message splitting. Useful to test joining lines. (default:false)USE_LOGFILEenv variable or-l / --use-logfileas command argument: Boolean flag to send logs to a logfile. (default:false)LOGFILEenv variable or-f / --logfileas command argument: Logfile location name if any logfile is set. (default:loggenerator.log)
Simply run loggenerator.py script with python:
python3 loggenerator.py -j -s 5 -t 2Or run by docker:
docker pull oleewere/loggenerator:v0.1.0
docker run --rm -e JSON_FORMAT=true -e SLEEP_INTERVAL_SEC=5 -e REPEAT_MESSAGES_BETWEEN_SLEEPS=2 oleewere/loggenerator:v0.1.0