-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
docker-compose-logs: add page #18937
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
Closed
anishk85
wants to merge
6
commits into
tldr-pages:main
from
anishk85:add-docker-compose-logs-command
Closed
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b54a6ec
docker-compose-logs: add page
anishk85 34496f8
Update pages/common/docker-compose-logs.md
anishk85 3f05bb1
Update pages/common/docker-compose-logs.md
anishk85 fb61907
Update pages/common/docker-compose-logs.md
anishk85 2ed3d7d
removed hyphen
anishk85 b7aaf1d
Update pages/common/docker-compose-logs.md
anishk85 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # docker compose logs | ||
|
|
||
| > View output from containers in a Docker Compose application. | ||
| > More information: <https://docs.docker.com/reference/cli/docker/compose/logs/>. | ||
|
|
||
| - View logs for all services: | ||
|
|
||
| `docker compose logs` | ||
|
|
||
| - View logs for a specific service: | ||
|
|
||
| `docker compose logs {{service_name}}` | ||
|
|
||
| - View logs and follow new output (like tail -f): | ||
|
|
||
| `docker compose logs {{[-f|--follow]}}` | ||
|
|
||
| - View logs with timestamps: | ||
|
|
||
| `docker compose logs {{[-t|--timestamps]}}` | ||
|
|
||
| - View only the last N lines of logs for each container: | ||
|
|
||
| `docker compose logs {{[-n|--tail]}} {{100}}` | ||
|
|
||
| - View logs from a specific time onwards: | ||
|
|
||
| `docker compose logs --since {{timestamp}}` | ||
|
|
||
| - View logs until a specific time: | ||
|
|
||
| `docker compose logs --until {{timestamp}}` | ||
|
|
||
| - View logs for multiple specific services: | ||
|
|
||
| `docker compose logs {{service1 service2 ...}}` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All are valid. Depends on what you want to do.
Do you want to describe the purpose of said number with words? Use
{{line_number}}Want to demonstrate with an example what the argument should look like? Use
{{2474627}}Want to keep it super simple with a one-letter variable? Use
{{n}}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially used {{100}} as an example value to show a realistic usage(showing the last 100 lines), which is a common option in Docker and Unix commands (--tail 100, similar to tail -n 100).
Since I agree with you to use a generic placeholder it's better for new users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of now for new users I think we should use line_count only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want a generic placeholder like
{{N}}.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use lowercase
{{n}}for consistency.