• Stars
    star
    246
  • Rank 164,726 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Logs collector for docker

docker-logger Go Report Card Docker Automated build

docker-logger is a small application collecting logs from other containers on the host that started without the -t option and configured with a logging driver that works with docker logs (journald and json-file). It can forward both stdout and stderr of containers to local, rotated files and/or to remote syslog.

note: dkll inlcudes all functionality of docker-logger, but adds server and cli client

Install

Copy provided 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.

Customization

All changes can be done via container's environment in docker-compose.yml or with command line

Command line Environment Default Description
--docker DOCKER_HOST unix:///var/run/docker.sock docker host
--syslog-host SYSLOG_HOST 127.0.0.1:514 syslog remote host (udp4)
--files LOG_FILES No enable logging to files
--syslog LOG_SYSLOG No enable logging to syslog
--max-size MAX_SIZE 10 size of log triggering rotation (MB)
--max-files MAX_FILES 5 number of rotated files to retain
--mix-err MIX_ERR false send error to std output log file
--max-age MAX_AGE 30 maximum number of days to retain
--exclude EXCLUDE excluded container names, comma separated
--include INCLUDE only included container names, comma separated
--include-pattern INCLUDE_PATTERN only include container names matching a regex
--exclude-pattern EXCLUDE_PATTERN only exclude container names matching a regex
TIME_ZONE UTC time zone for container
--json, -j JSON false output formatted as JSON
  • at least one of destinations (files or syslog) should be allowed
  • location of log files can be mapped to host via volume, ex: - ./logs:/srv/logs (see docker-compose.yml)
  • both --exclude and --include flags are optional and mutually exclusive, i.e. if --exclude defined --include not allowed, and vise versa.
  • both --include and --include-pattern flags are optional and mutually exclusive, i.e. if --include defined --include-pattern not allowed, and vise versa.

Build from the source

  • clone this repo - git clone https://github.com/umputun/docker-logger.git
  • build the logger - cd docker-logger && docker build -t umputun/docker-logger .
  • 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

More Repositories

1

remark42

comment engine
Go
4,881
star
2

reproxy

Simple edge server / reverse proxy
Go
1,212
star
3

spot

A user-friendly and efficient tool for the effortless deployment and configuration of resources on remote machines.
Go
349
star
4

secrets

secrets kept safe
Go
143
star
5

tg-spam

Anti-Spam bot for Telegram
Go
140
star
6

feed-master

Pulls multiple podcast feeds (RSS) and republishes as a common feed, properly sorted and podcast-client friendly.
Go
116
star
7

baseimage

minimalistic docker base image to build and deploy apps
Shell
114
star
8

updater

Simple web-hook based receiver executing things via HTTP request
Go
108
star
9

cronn

cron service with extras
Go
85
star
10

dkll

Agent, server and client to collect and access logs in dockerized infrastructure
Go
66
star
11

rss2twitter

publish rss updates to twitter
Go
56
star
12

sys-agent

System agent. Reports server status via HTTP API
Go
50
star
13

github-backup-docker

Docker wrapper for github-backup
Shell
49
star
14

echo-http

Echo http service
Go
44
star
15

monit-docker

Dockerized monit
Python
43
star
16

rlb

Redirecting Load Balancer
Go
40
star
17

ghost-buster-docker

Ready to use ghost with buster and auto-generation in docker container
Shell
39
star
18

proxy-cron

A simple proxy with crontab scheduling
Go
14
star
19

pi-radio

Python
14
star
20

mongo-auth

mongo docker with auth
Shell
12
star
21

rlb-stats

Stats collector and reporter for RLB
Go
7
star
22

le-dns-updater

Update LE certs with DNS challenge
Shell
3
star
23

remark42-site

remark42.com site
HTML
2
star
24

umputun.dev

umputun.dev website
HTML
2
star
25

fm-config

FeedMaster configuration for podcasts
Dockerfile
1
star
26

esvn

GUI frontend to the Subversion revision system
HTML
1
star
27

homebrew-apps

Homebrew thing
Ruby
1
star