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

docker logs change tail default #40452

Open
augnustin opened this issue Feb 4, 2020 · 8 comments
Open

docker logs change tail default #40452

augnustin opened this issue Feb 4, 2020 · 8 comments
Labels
area/cli area/logging kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@augnustin
Copy link

docker logs

outputs the whole container history, which is non-sense for a container that has been alive for some time.

Hence as far as I'm concerned, I always have type docker logs --tail=100 -f <container_name> which is crazy long for something that feels like a default behavior.

Whichever value different than all would work for me: eg. 10 ou 100.

But who wants to output 10k lines by default and block the process for 2/3mins?

@thaJeztah thaJeztah added area/cli kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Feb 4, 2020
@thaJeztah
Copy link
Member

This would have to be implemented in the cli (github.com/docker/cli). While I understand the request, my concern is that changing the behaviour would likely be a breaking change (the behaviour has been like this for a long time (--tail was added in #6803, so the default was there before that).

@cpuguy83 wdyt?

@cpuguy83
Copy link
Member

cpuguy83 commented Feb 4, 2020

Current default is indeed silly, just that it's had a long long history.
It's probably fine to change the CLI's default.

Alternatively we could do something like what journalctl does and essentially pipe it through less when stdin is a TTY.

@cpuguy83
Copy link
Member

cpuguy83 commented Feb 4, 2020

We could also enforce a default max size so we don't spew gobs and gobs of logs.

@thaJeztah
Copy link
Member

should the default driver be the local driver (which has a max by default)?

@cpuguy83
Copy link
Member

cpuguy83 commented Feb 4, 2020

Oh I was thinking max read size more than max store size.

@augnustin
Copy link
Author

Great to read that this query is nicely welcomed.

I understand the backward-compatibility concern and can't tell how painful this could be to some users.

🤞 so that an acceptable solution is found.

@tao12345666333
Copy link
Contributor

Current default is indeed silly, just that it's had a long long history.
It's probably fine to change the CLI's default.

+1

Usually I give it an alias

alias "dlt"="docker logs --tail=100"

@hammad13060
Copy link

@thaJeztah I've faced similar issue while using docker logs command. Sometimes it makes the debugging hard in Dev environments because debug logs are also enabled. I've completed the Dev environment setup of the moby package. I'd love to discuss the solution and contribute. Could you please assign this issue to me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli area/logging kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
None yet
Development

No branches or pull requests

5 participants