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_SEC
env variable or-s / --sleep-interval
as command argument: Sleep interval between log generation events in seconds. (default:10
)REPEAT_MESSAGES_BETWEEN_SLEEPS
env variable or-t / --times
as command argument: Repeat messages number between sleeps. (default:1
)JSON_FORMAT
env variable or-j / --json-format
as command argument: Boolean flag to enable json formatted logging. (default:false
)DOCKER_FORMAT
env variable or-d / --docker-format
as command argument: Boolean flag to enable docker formatted logging. (default:false
)BROKEN_JSON
env variable or-b / --use-broken-json
as command argument: Boolean flag to enable json message splitting. Useful to test joining lines. (default:false
)USE_LOGFILE
env variable or-l / --use-logfile
as command argument: Boolean flag to send logs to a logfile. (default:false
)LOGFILE
env variable or-f / --logfile
as 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 2
Or 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