Typicaly, application-server output logs by log4xxx and send any other service (e.g. AWS S3, elasticsearch) by fluentd's in_tail plugin.
- app output logs
- fluentd in_tail watch logs
- fluentd tagging & transfar other servers/services
1st, We build single contaner by supervisord
supervisord
|- app
|- fluentd
On the other hand, this sample
app container => docker volume <= fluent container
Output /applog/test.log each sec, and rotate by 30 secs.
Mounted by app & fluentd-send /applog .
in_tail /applog/test.log & tagging docker docker.testlog
& foward to fluentd-recv
.
Vanilla fluent/fluentd
. see original Dockerfile.
docker-compose build
docker-compose up -d fluentd-recv
docker-compose up -d
## wait several mins
docker-compose exec fluentd-recv ls /fluentd/log
docker-compose exec fluentd-recv cat /fluentd/log/docker.log