GithubHelp home page GithubHelp logo

bamboox / fluentd-pilot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aliyuncontainerservice/log-pilot

1.0 4.0 0.0 9.38 MB

Collect logs in docker containers

License: Apache License 2.0

Shell 25.33% Smarty 2.50% Ruby 14.34% Go 55.49% Python 2.34%

fluentd-pilot's Introduction

fluentd-pilot

CircleCI

fluentd-pilot is an awesome docker log tool. With fluentd-pilot you can collect logs from docker hosts and send them to your centralize log system such as elasticsearch, graylog2, awsog and etc. fluentd-pilot can collect not only docker stdout but also log file that inside docker containers.

Try it

Prerequisites:

  • docker-compose >= 1.6
  • Docker Engine >= 1.10
git clone [email protected]:AliyunContainerService/fluentd-pilot.git
cd fluentd-pilot/quickstart
./run

Then access kibana under the tips. You will find that tomcat's has been collected and sended to kibana.

Create index: kibana

Query the logs: kibana

Quickstart

Run pilot

docker run --rm -it \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /:/host \
    registry.cn-hangzhou.aliyuncs.com/acs-sample/fluentd-pilot:latest

Run applications whose logs need to be collected

Open a new terminal, run the application. With tomcat for example:

docker run -it --rm  -p 10080:8080 \
    -v /usr/local/tomcat/logs \
    --label aliyun.logs.catalina=stdout \
    --label aliyun.logs.access=/usr/local/tomcat/logs/localhost_access_log.*.txt \
    tomcat

Now watch the output of fluentd-pilot. You will find that fluentd-pilot get all tomcat's startup logs. If you access tomcat with your broswer, access logs in /usr/local/tomcat/logs/localhost_access_log.\*.txt will also be displayed in fluentd-pilot's output.

More Info: Documents

Feature

  • Single fluentd process per docker host. You don't need to create new fluentd process for every docker container.
  • Support both stdout and file. Either Docker log driver or logspout can only collect stdout.
  • Declarative configuration. You need do nothing but declare the logs you want to collect.
  • Support many log management: elastichsearch, graylog2, awslogs and more.
  • Tags. You could add tags on the logs collected, and later filter by tags in log management.

Build fluentd-pilot

Prerequisites:

  • Go >= 1.6
go get github.com/AliyunContainerService/fluentd-pilot
cd $GOPATH/github.com/AliyunContainerService/fluentd-pilot/docker-images
./build.sh # This will create a new docker image named pilot:latest

Contribute

You are welcome to make new issues and pull reuqests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.