Skip to content

Logging drivers - #10568

Merged
icecrime merged 4 commits into
moby:masterfrom
LK4D4:logging_drivers
Mar 17, 2015
Merged

icecrime merged 4 commits into
moby:masterfrom
LK4D4:logging_drivers

Conversation

@LK4D4

@LK4D4 LK4D4 commented Feb 4, 2015

Copy link
Copy Markdown
Contributor

Initial try to implement logging driver interface. I skipped fetching logs part from #7195 because it makes sense only for docker logs and actually docker logs is not very actively used.
It is pretty easy to implement logging driver with this, I have syslog and remote in mind. Remote will just send serialized logger.Messages to tcp socket.
Awaiting your comments.

@tianon

tianon commented Feb 4, 2015

Copy link
Copy Markdown
Member

--log-driver=none! 😍

@tianon

tianon commented Feb 4, 2015

Copy link
Copy Markdown
Member

"docker logs is not very actively used" << I think you're going to need to backup this statement with some stats or some facts, because I actively use docker logs -f and docker logs -f --tail=... every single day 😉

(but I don't need fetch+truncate)

@paultag

paultag commented Feb 4, 2015

Copy link
Copy Markdown

❤️ --log-driver=none ❤️

@LK4D4

LK4D4 commented Feb 4, 2015

Copy link
Copy Markdown
Contributor Author

@tianon How didn't you notice #10424 ? :) Maybe for debugging docker logs is very cool, but for production system pretty useless.

@jessfraz

jessfraz commented Feb 4, 2015

Copy link
Copy Markdown
Contributor

@paultag will be excited :D

On Wed, Feb 4, 2015 at 3:03 PM, Alexander Morozov [email protected]
wrote:

@tianon https://github.com/tianon How didn't you notice #10424
#10424 ? :) Maybe for debugging docker
logs is very cool, but for production system pretty useless.

—
Reply to this email directly or view it on GitHub
#10568 (comment).

@paultag

paultag commented Feb 4, 2015

Copy link
Copy Markdown

I AM SO EXCITED

🎊 🎊 🎊
💃 💃 💃

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad merge?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, hard to track them in docs :(

@LK4D4

LK4D4 commented Feb 5, 2015

Copy link
Copy Markdown
Contributor Author

I'm pretty sure that there is some race :) Also whole test TestImagesFilterWhiteSpaceTrimmingAndLowerCasingWorking is pretty suspicious.

@LK4D4

LK4D4 commented Feb 5, 2015

Copy link
Copy Markdown
Contributor Author

Omg, it's green

@jessfraz

jessfraz commented Feb 5, 2015

Copy link
Copy Markdown
Contributor

\o/

On Thu, Feb 5, 2015 at 2:04 PM, Alexander Morozov [email protected]
wrote:

Omg, it's green

—
Reply to this email directly or view it on GitHub
#10568 (comment).

@tianon

tianon commented Feb 5, 2015

Copy link
Copy Markdown
Member

@LK4D4 yeah, I noticed it, but formatting doesn't bother me -- the information is all there, and there's absolutely no possible chance that a stray "Ctrl+C" kills my production process with docker logs 😉

@LK4D4

LK4D4 commented Feb 5, 2015

Copy link
Copy Markdown
Contributor Author

Also, question: should we throw an error for logs if driver is not default?

@tianon

tianon commented Feb 5, 2015 via email

Copy link
Copy Markdown
Member

@unclejack

Copy link
Copy Markdown
Contributor

--log-driver=none is very useful.

LGTM

@jessfraz

jessfraz commented Feb 7, 2015

Copy link
Copy Markdown
Contributor

LGTM

@LK4D4

LK4D4 commented Feb 7, 2015

Copy link
Copy Markdown
Contributor Author

@fredlf @SvenDowideit @jamtur01 Could you look at docs please?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

driver (default/none)

@LK4D4

LK4D4 commented Feb 9, 2015

Copy link
Copy Markdown
Contributor Author

@jamtur01 fixed, thanks. PTAL

Comment thread api/client/commands.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logs are?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, maybe quotes or "logs" command?

@jamtur01

jamtur01 commented Feb 9, 2015

Copy link
Copy Markdown
Contributor

Minor comment - otherwise LGTM.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container's

@fredlf

fredlf commented Feb 9, 2015

Copy link
Copy Markdown
Contributor

Just a couple of copy edits. LGTM otherwise.

Comment thread docs/sources/reference/run.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add how this affects (or not) the functioning of docker logs for that container, and if it changes that, add some info to the help for docker logs to tell the user how to know.

similarly for the API

I would suggest that docker logs should return a message like logging disabled so the user knows what is happening and why.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it is returning. I'll add info to all places.

@calavera

Copy link
Copy Markdown
Contributor

@gdm85 addresses really good concerns, but I feel like they're something that can be tackled after shipping this first implementation. There is never going to be a perfect solution, specially if we want to enter the network partitions space.

My vote(if it's any valuable) would be to merge this, gather more feedback with real use cases and keep iterating.

Comment thread daemon/inspect.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand the need for this. In all cases, shouldn't we better copy the hostConfig structure and modifying the copy instead of altering the container config in place?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, I just copied behavior of links. Want me to fix that in this PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see the Links code above. Let's keep this as it is, I'll change both in a later PR.

@gdm85

gdm85 commented Mar 17, 2015

Copy link
Copy Markdown
Contributor

@LK4D4 that's already fair enough for me :)

@icecrime

Copy link
Copy Markdown
Contributor

LGTM 👍

@LK4D4

LK4D4 commented Mar 17, 2015

Copy link
Copy Markdown
Contributor Author

@icecrime It have three LGTMS from docs team btw :)

@icecrime

Copy link
Copy Markdown
Contributor

🤦

icecrime pushed a commit that referenced this pull request Mar 17, 2015
@icecrime
icecrime merged commit 1ff5a91 into moby:master Mar 17, 2015
@LK4D4
LK4D4 deleted the logging_drivers branch March 17, 2015 16:46
@LK4D4

LK4D4 commented Mar 17, 2015

Copy link
Copy Markdown
Contributor Author

@ibuildthecloud Waiting for your PRs! We still have chance to merge them to 1.6

@sirupsen

Copy link
Copy Markdown
Contributor

@LK4D4 @ibuildthecloud would be awesome to see syslog in 1.6 for sure.

@sirupsen

Copy link
Copy Markdown
Contributor

@LK4D4 my only concern with this is what if I want to write crazy-log-driver-0mg that nobody in upstream Docker has any need for?

That would mean I'd have to fork Docker, and I don't think upstream Docker is interested in e.g. a Kafka driver, msgpack driver, some other logging API over HTTP etc., only major use cases like syslog and systemd I see make it into Docker core. As I see it there's a number of ways to solve this, what are your thoughts on this? Named pipe driver?

@ibuildthecloud

Copy link
Copy Markdown
Contributor

@LK4D4 @sirupsen syslog -> #11458, rollover coming hopefully in the next hour or so

@LK4D4

LK4D4 commented Mar 18, 2015

Copy link
Copy Markdown
Contributor Author

@sirupsen I thought about generic driver, which just writes serialized messages to tcp socket. Only configuration is host:port and serialization/compress protocol(that makes sense to support I think).

@tiborvass

Copy link
Copy Markdown
Contributor

@sirupsen I believe that will be done with docker plugins/extensions. Until then, an alternative once the syslog PR is merged, is to write an adapter that receives syslog messages and forwards them to your custom logging server transforming the message on the fly.

@sirupsen

Copy link
Copy Markdown
Contributor

@LK4D4 I was going to start working on the TCP driver, but couple of implementation questions: What should the command line interface be like for configuring the address and serialization? Does TCP really make more sense than UDP here? Fire-and-forget seems somewhat reasonable, given that the client's logging daemon may have crashed. For similar reasons I didn't want to implement a named pipe, because a crashed client could cause the container to hang easily. Of course we can protect against that, but it seems reasonable to use a protocol that handles that entirely. Perhaps we just need both.

@LK4D4

LK4D4 commented Mar 20, 2015

Copy link
Copy Markdown
Contributor Author

@sirupsen I'm okay with UDP. Settings for logging were proposed in #11485 and I think design is okay.

@sirupsen

Copy link
Copy Markdown
Contributor

@tiborvass can you tell me more about this planned Docker plugin/extensions API? Curious.

@rgbkrk

rgbkrk commented Mar 23, 2015

Copy link
Copy Markdown

Thank you so much for this @LK4D4 and the Docker team overall for the great review+inclusion. Excited for 1.6 release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.