Sign inSign up

jamesasher/logger

By jamesasher

•Updated over 7 years ago

Simple local logging container for use with HTTP from a client service.

Image
0

73

jamesasher/logger repository overview

⁠Simple logger container to call within your swarm via http to log to the console or to a file.

Console-based logs are sent to the console.

File-based logs are stored inside the container at c:/logs

Start the container with:

 docker run -d -p 8080:80 --name logger jamesasher:logger

To place logs on the HOST instead of inside the container:

 docker run -d --name logger -p 8080:80 -v C:/log:C:/log jamesasher/logger

Console output on startup:

-- Logger running on http://{hostIP}:{hostPort}

URLS: 

GET /

GET /api

PUT /api/log/console

PUT /api/log/file

GET /api/log/file/rotate

GET /api/status

GET /api/stop

-------------------------------------------

Configure with environment variables:

env vardescription
CONLOGGERPORT={Port}specify the port to listen on
CONLOGGERFILE={path/file}specify the path and file to place lots

After starting logger you can review the logs sent to the console with:

docker logs logger

Call the logger with CURL:

curl --header "Content-Type: application/json"  --request POST  --data "This is my console log entry"  http://localhost:8080/api/log/console

curl --header "Content-Type: application/json"  --request POST  --data "This is my file log entry"  http://localhost:8080/api/log/file

curl http://localhost:8080/api/stop

Tag summary

Content type

Image

Digest

Size

2.1 GB

Last updated

over 7 years ago

docker pull jamesasher/logger