Giter VIP home page Giter VIP logo

random-logger's Introduction

random-logger

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

release Docker Image Version (latest by date)

What is this?

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

  • 2018-03-02T22:33:27-06:00 ERROR something happened in this execution.
  • 2018-03-02T22:33:27-06:00 INFO takes the value and converts it to string.
  • 2018-03-02T22:33:27-06:00 WARN variable not in use.
  • 2018-03-02T22:33:27-06:00 DEBUG first loop completed.

Why this Image?

I've had the necessity to create a random 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 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 chentex/random-logger:latest

# use different intervals to print logs every random(100, 400) milliseconds
docker run chentex/random-logger:latest 100 400

# use the third parameter so limit the number of loglines (after generating the lines the container will stop).
# if not set it runs infinite
docker run chentex/random-logger:latest 100 400 100

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

You will have now a docker container running and generating 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 chentex/random-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/chentex/random-logger.git

Go to the folder in your terminal and type this:

# cd into folder
cd random-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

random-logger's People

Contributors

chentex avatar herveleclerc avatar jeammyb avatar timbleimehl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

random-logger's Issues

Fix alpine version

Right now we are pulling latest we should be pulling a specific version, update to 3.6

Feature request: print unique random tags

I've come across your Docker image. It's very handy.

A feature request:

All the messages currently consist of very common words, and the entire sentence is fixed and repeated. When they are mixed with tons of other applications' logs in a data lake (e.g., in Elasticsearch, Datadog, Splunk, etc.), it is very hard to query for a particular message from your running container.

So, why not append each message with a dynamically generated random string -- each log line has a different, unique string. That will give the best of both worlds:

  1. You can query for the fixed part of your current message in order to get all messages from your particular container.
  2. You can also query for that random string to pinpoint a particular occurrence of a message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.