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

Send zookeeper logs to standard out #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mannytoledo
Copy link
Contributor

Redirecting zookeeper output to stdout to make it easier to monitor with standard docker tools.

@brandongalbraith
Copy link

@mannytoledo Could this be optional and have the linking be done as a conditional if an environment variable is passed into the container?

@mannytoledo
Copy link
Contributor Author

@brandongalbraith Is there a use case where a user wouldn't want zookeeper logs accessible from the running container?

I originally though of making it optional but figured the app this container wraps should be accessible via docker logs.

@brandongalbraith
Copy link

@mannytoledo Not sure about a use case where you wouldn't want logs; I'm thinking about people already using this in production who are expecting a certain behavior (logs not send to stdout).

@mannytoledo
Copy link
Contributor Author

@brandongalbraith Fair enough, expect an update on this soon.

@brandongalbraith
Copy link

Thanks @mannytoledo!

@mannytoledo
Copy link
Contributor Author

I went ahead and made that optional @brandongalbraith @mbabineau

Let me know what you guys think.

@brandongalbraith
Copy link

@mannytoledo 👍

@panda87
Copy link

panda87 commented May 1, 2016

Thanks @mannytoledo for this PR.
Someone has an idea how to set logrotate to zk logs?
Im using this repo and my zookeeper.out log is now a huge file and I dont know how to set logrotate for that.

@brandongalbraith
Copy link

@panda87

See http://www.jamescoyle.net/cheat-sheets/676-logrotate-cheat-sheet on how to logrotate zookeeper.out. A suggestion would be:

/opt/zookeeper/zookeeper.out {
  daily
  rotate 7
  compress
  copytruncate
  missingok
}

placed in a file such as /etc/logrotate.d/zookeeper. This would rotate logs daily, compress rotated logs, and keep seven days of log history. It also prevents errors if the log doesn't exist.

@panda87
Copy link

panda87 commented May 2, 2016

Thanks @brandongalbraith. I will add that to my docker container

@brandongalbraith
Copy link

@panda87 You'd set that up on your host running the docker container, not
within the docker container.

On Monday, May 2, 2016, panda87 [email protected] wrote:

Thanks @brandongalbraith https://github.com/brandongalbraith. I will
add that to my docker container


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#14 (comment)

@panda87
Copy link

panda87 commented May 2, 2016

This is the best practice? because the json file log is located in the /var/lib/docker dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants