Sign inSign up

idebman/random-json-logger

By idebman

•Updated about 2 years ago

Docker image for a random log generator.

Image
Monitoring & observability
0

1.6K

idebman/random-json-logger repository overview

⁠random-json-logger

Docker image for a random json log generator, based on Alpine Linux.

⁠What is this?

This image will execute a container which will generate four random log messages:

{"timestamp": "2018-03-02T22:33:27", "level":"ERROR", "hostname":"my-host", "message": "something happened in this execution."}
{"timestamp": "2018-03-02T22:33:27", "level":"INFO", "hostname":"my-host", "message": "takes the value and converts it to string."}
{"timestamp": "2018-03-02T22:33:27", "level":"WARN", "hostname":"my-host","message": "variable not in use."}
{"timestamp": "2018-03-02T22:33:27", "level":"DEBUG", "hostname":"my-host", "message": "first loop completed."}

⁠Why this Image?

I've had the necessity to create a random json logger to test log configurations with containers, this helped me out to do it easily.

⁠What is inside of this repo?

In this git repository you will find the docker image definitions for the random json Logger for Alpine Linux

  • Dockerfile -> Contains image definition.
  • entrypoint.sh -> Shell code to generate log messages.

⁠How do I use this image?

To use this image you must do as follows:

# you can use tags latest
docker pull idebman/random-json-logger:latest

# to run the image just execute
docker run -d idebman/random-json-logger:latest

You will have now a docker container running and generating json log messages, locate it running:

docker ps

You can see the logs using this command

docker logs <- container-id ->

⁠How do I build this images?

First things first, you can find these docker images in sikwan/random-json-logger but you can also build a specific version on your own, you only need:

  • docker
  • git

Clone this repo

git clone https://github.com/debMan/random-json-logger.git

Go to the folder in your terminal and type this:

# cd into folder
cd random-json-logger
# Then build the new image
docker build -f Dockerfile .

If you want to tag your image use the following command

docker build -f Dockerfile -t yourbase/yourname:version .

For more on docker build reference to the Documentation⁠

You can get the source from the image in the Repository⁠

Tag summary

Content type

Image

Digest

sha256:f6d87f2a2…

Size

1.9 MB

Last updated

about 2 years ago

docker pull idebman/random-json-logger