{"id":13582347,"url":"https://github.com/umputun/docker-logger","last_synced_at":"2025-04-06T10:14:08.914Z","repository":{"id":144202291,"uuid":"116537382","full_name":"umputun/docker-logger","owner":"umputun","description":"Logs collector for docker","archived":false,"fork":false,"pushed_at":"2024-09-01T02:40:25.000Z","size":6588,"stargazers_count":246,"open_issues_count":5,"forks_count":36,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-16T09:20:33.032Z","etag":null,"topics":["docker","logger","logging","sidecar","syslog"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umputun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["umputun"]}},"created_at":"2018-01-07T04:30:18.000Z","updated_at":"2024-08-01T04:14:27.000Z","dependencies_parsed_at":"2024-05-13T07:39:31.779Z","dependency_job_id":"a69c9822-847f-4de3-967f-f8b32681f472","html_url":"https://github.com/umputun/docker-logger","commit_stats":{"total_commits":85,"total_committers":8,"mean_commits":10.625,"dds":0.5058823529411764,"last_synced_commit":"e68991ac1542c07b21ce08e203a2fb893c1de0f4"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umputun%2Fdocker-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umputun%2Fdocker-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umputun%2Fdocker-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umputun%2Fdocker-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umputun","download_url":"https://codeload.github.com/umputun/docker-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464225,"owners_count":20942970,"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":["docker","logger","logging","sidecar","syslog"],"created_at":"2024-08-01T15:02:37.485Z","updated_at":"2025-04-06T10:14:08.873Z","avatar_url":"https://github.com/umputun.png","language":"Go","readme":"# docker-logger [![Go Report Card](https://goreportcard.com/badge/github.com/umputun/docker-logger)](https://goreportcard.com/report/github.com/umputun/docker-logger) [![Docker Automated build](https://img.shields.io/docker/automated/jrottenberg/ffmpeg.svg)](https://hub.docker.com/r/umputun/docker-logger/)\n\n\n**docker-logger** is a small application collecting logs from other containers on the host that started without\nthe `-t` option and configured with a logging driver that works with docker logs (journald and json-file).\nIt can forward both stdout and stderr of containers to local, rotated files and/or to remote syslog.\n\n_note: [dkll](https://github.com/umputun/dkll) inlcudes all functionality of docker-logger, but adds server and cli client_\n\n## Install\n\nCopy provided [docker-compose.yml](https://github.com/umputun/docker-logger/blob/master/docker-compose.yml), customize if needed and run with `docker-compose up -d`. By default `docker-logger` will collect all logs from containers and put it to `./logs` directory.\n\n## Customization\n\nAll changes can be done via container's environment in `docker-compose.yml` or with command line\n\n| Command line        | Environment       | Default                     | Description                                   |\n|---------------------|-------------------| --------------------------- |-----------------------------------------------|\n| `--docker`          | `DOCKER_HOST`     | unix:///var/run/docker.sock | docker host                                   |\n| `--syslog-host`     | `SYSLOG_HOST`     | 127.0.0.1:514               | syslog remote host (udp4)                     |\n| `--files`           | `LOG_FILES`       | No                          | enable logging to files                       |\n| `--syslog`          | `LOG_SYSLOG`      | No                          | enable logging to syslog                      |\n| `--max-size`        | `MAX_SIZE`        | 10                          | size of log triggering rotation (MB)          |\n| `--max-files`       | `MAX_FILES`       | 5                           | number of rotated files to retain             |\n| `--mix-err`         | `MIX_ERR`         | false                       | send error to std output log file             |\n| `--max-age`         | `MAX_AGE`         | 30                          | maximum number of days to retain              |\n| `--exclude`         | `EXCLUDE`         |                             | excluded container names, comma separated     |\n| `--include`         | `INCLUDE`         |                             | only included container names, comma separated |\n| `--include-pattern` | `INCLUDE_PATTERN` |                             | only include container names matching a regex |\n| `--exclude-pattern` | `EXCLUDE_PATTERN` |                             | only exclude container names matching a regex |\n|                     | `TIME_ZONE`       | UTC                         | time zone for container                       |\n| `--json`, `-j`      | `JSON`            | false                       | output formatted as JSON                      |\n\n\n- at least one of destinations (`files` or `syslog`) should be allowed\n- location of log files can be mapped to host via `volume`, ex: `- ./logs:/srv/logs` (see `docker-compose.yml`)\n- both `--exclude` and `--include` flags are optional and mutually exclusive, i.e. if `--exclude` defined `--include` not allowed, and vise versa.\n- both `--include` and `--include-pattern` flags are optional and mutually exclusive, i.e. if `--include` defined `--include-pattern` not allowed, and vise versa.\n\n## Build from the source\n\n- clone this repo - `git clone https://github.com/umputun/docker-logger.git`\n- build the logger - `cd docker-logger \u0026\u0026 docker build -t umputun/docker-logger .`\n- try it - `docker run -it --rm -v $(pwd)/logs:/srv/logs -v /var/run/docker.sock:/var/run/docker.sock umputun/docker-logger /srv/docker-logger --files`\n","funding_links":["https://github.com/sponsors/umputun"],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumputun%2Fdocker-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumputun%2Fdocker-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumputun%2Fdocker-logger/lists"}