Skip to content

Simple log generator that loops and logs lines found in an example log file

License

Notifications You must be signed in to change notification settings

diebietse/log-generator

Repository files navigation

Log Generator

A very basic program that reads a list of lines to log from a config file.

It then logs the lines in the file one at a time and then loops back and repeats it

Run Locally

You can run it locally with:

go run main.go

Or with a custom delay between logs and a custom config with:

go run main.go --log_source_file_path=example_logs.txt --log_delay_seconds=1

You can also run it in docker using:

make docker
make run docker

Run K8s

Create a configmap named log-config with key log-config containing the example logs:

kubectl create configmap log-config --from-file=log-config=example_logs.txt --dry-run=client -o yaml | kubectl apply -f -

Create a deployment of the log-generator:

kubectl apply -f ./k8s.yml