Skip to content

Instantly share code, notes, and snippets.

@drozzy drozzy/README.md
Last active Mar 7, 2018

Embed
What would you like to do?
Docker Compose example of Logspout and OKLog

This is an example of how to automatically log all the messages from docker containers. Logspout listens to containers and automatically routes the logs to OKLog.

To run the example simply issue:

docker-compose up -d

command. The test service here is simply to genereate a "Hello World" message. You would replace this with other services that are in your compose files.

You can browse UI here (there seem to be some issues with UI here, I'm not getting very consistent behavior):

http://localhost:7650/ui/

version: "3"
volumes:
oklog:
services:
test:
image: ubuntu:latest
command: echo Hello World
depends_on:
- logspout
logspout:
image: gliderlabs/logspout
command:
- "syslog+tcp://oklog:7651"
ports:
- "8000:80"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
depends_on:
- oklog
networks:
- logging
oklog:
image: oklog/oklog
volumes:
- oklog:/data
ports:
- 7650:7650
command: ingeststore -store.segment-replication-factor 1
networks:
- logging
# We need a common network because logspout sends data to oklog
networks:
logging:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.