{"id":21722440,"url":"https://github.com/timstott/docker-log-drivers-adventures","last_synced_at":"2026-05-09T09:04:44.901Z","repository":{"id":74257203,"uuid":"40985859","full_name":"timstott/docker-log-drivers-adventures","owner":"timstott","description":"Adventures with Docker log drivers","archived":false,"fork":false,"pushed_at":"2015-10-09T11:02:30.000Z","size":496,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T22:07:09.085Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timstott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-18T17:10:37.000Z","updated_at":"2015-08-18T17:11:06.000Z","dependencies_parsed_at":"2023-03-11T16:53:48.688Z","dependency_job_id":null,"html_url":"https://github.com/timstott/docker-log-drivers-adventures","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timstott/docker-log-drivers-adventures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstott%2Fdocker-log-drivers-adventures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstott%2Fdocker-log-drivers-adventures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstott%2Fdocker-log-drivers-adventures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstott%2Fdocker-log-drivers-adventures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timstott","download_url":"https://codeload.github.com/timstott/docker-log-drivers-adventures/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstott%2Fdocker-log-drivers-adventures/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259293185,"owners_count":22835550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T02:29:03.061Z","updated_at":"2026-05-09T09:04:44.817Z","avatar_url":"https://github.com/timstott.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adventures with Docker log drivers\n\nEvaluate native Docker log driver integration with GrayLog.\n\n## Prerequisite\n\n- Docker 1.8\n- `docker.local` host points to your docker host\n\nIn the following exmaples logs are generated by a dummy Sinatra application.\n\nBuild the dummy application with `docker build -t sinatra_docker ./sinatra`\n\nGenerate logs by making requests `curl http://docker.local:9292`\n\n## GELF Output\n\nDocker formats logs in GELF and sends them to GrayLog over UDP.\n\nTo view the output in GrayLog start a GrayLog instance with a GELF UDP input.\n\n```\ndocker run -i -t -p 9229:9292 --log-driver=gelf --log-opt gelf-address=udp://docker.local:12201 sinatra_docker\n```\n\n### Sample Output\n\n![](images/docker_gelf_log_driver.png)\n\n### Observations\n\nDocker wraps the message outputed by the application in a new GELF message. The original message becomes a String.\n\nGrayLog provides `Extractors` to extract data from any text message. It is tedious to work with when messages attributes are variable.\n\nMessages with length over 30k were sent without problems. \n\n\n## Fluentd Output\n\nView the output in fluentd with `docker-compose up`\n\n```\ndocker run -i -t -p 9292:9292 --log-driver=fluentd --log-opt fluentd-address=docker.local:24224 sinatra_docker\n```\n\n### Observations\n\nSimilarly to the GELF log driver, Docker wraps the message outputed by the application.\nThe log driver then forwards the logs to a fluentd agent.\nThere custom formatters and outputs can be added to the fluentd agent to extract the application message.\n\nAs oposed to GrayLog `Extractors` fluentd formatters are more flexible to parse and format messages.\n\nThe fluentd log driver send logs to the agent over TCP. Preliminary observations revealed the log driver does not reconnect to the agen when the connection breaks.\nThis needs further investigation.\n\n## ~~docker-compose~~\nThe lastest version does not provide support for fluentd and gelf log drivers (docker/compose#1878).\n\n- docker-compose \u003e 1.4\n- `docker.local` points to your docker host\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimstott%2Fdocker-log-drivers-adventures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimstott%2Fdocker-log-drivers-adventures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimstott%2Fdocker-log-drivers-adventures/lists"}