Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup logging #116

Open
etoews opened this issue May 4, 2016 · 2 comments
Open

Setup logging #116

etoews opened this issue May 4, 2016 · 2 comments
Assignees
Labels

Comments

@etoews
Copy link
Contributor

etoews commented May 4, 2016

No description provided.

@etoews etoews added the carina label May 4, 2016
@etoews etoews self-assigned this May 4, 2016
@etoews etoews added the ready label May 4, 2016
@etoews
Copy link
Contributor Author

etoews commented May 9, 2016

It's looking like we won't be able to use logging drivers with overlay networks. 😞

moby/moby#20370 (comment)

@etoews
Copy link
Contributor Author

etoews commented May 10, 2016

I had a bit of success using Filebeat to log directly to ElasticSearch with overlay networks.

All logs on the node are getting shipped, including Swarm container logs, but I think we should be able to filter those out with Filebeat config (config reference).

Filebeat Dockerfile

FROM debian:jessie

RUN apt-get -y update
RUN apt-get -y install apt-transport-https
RUN apt-get -y install curl
RUN curl https://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
RUN echo "deb https://packages.elastic.co/beats/apt stable main" | tee -a /etc/apt/sources.list.d/beats.list

RUN apt-get -y update
RUN apt-get -y install filebeat

ADD filebeat.yml /etc/filebeat/filebeat.yml

ENTRYPOINT ["/usr/bin/filebeat", "-e", "-v", "-c", "/etc/filebeat/filebeat.yml"]

filebeat.yml

filebeat:
  # List of prospectors to fetch data.
  prospectors:
    -
      paths:
        - /var/lib/docker/containers/*/*.log
      input_type: log
      ignore_older: 5m
output:
  elasticsearch:
    hosts: ["elasticsearch:9200"]

Commands

docker build -t filebeat .
docker run --detach --name=filebeat --net logging -v /var/lib/docker:/var/lib/docker filebeat

@etoews etoews removed the ready label May 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant