This container is meant to output Docker journald logs in json format so that they can be shipped to a log collector. This allows for local logging to still function while also outputting the logs to a consumable format for most log forwarders.
- Clone this repo
- Create
/etc/docker/daemon.jsonwith the following contents:
{
"log-driver": "journald"
}
- Restart the Docker daemon for changes to take effect
docker stack deploy -c docker-compose.yml logbook- Set your log forwarder to use
logbook_docker-journalas an external volume or bind mount/var/lib/docker/volumes/logbook_docker-journal/_data:/logs
- Refer to the README in this repository for extending to use with the ELK stack.
The environment variables LOG_SIZE and NUM_SEGM can be specified in the compose file to define the default log size, and how many segments to keep.