-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
base: main
Are you sure you want to change the base?
docker-compose-logs: add page #18937
Conversation
Add page for docker-compose logs command to view output from containers.
The CI failure is due to Docker Hub service unavailability (503 error), not related to the PR changes. The checks should pass once Docker Hub services are restored. |
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.
Also I noticed that the page uses the older docker-compose
CLI. The newer one uses docker compose
(without the hyphen).
Co-authored-by: Harshavardhan <[email protected]>
Co-authored-by: Harshavardhan <[email protected]>
Co-authored-by: Harshavardhan <[email protected]>
@TheRootDaemon thanks for pointing out this issue of newer version. |
Is the new version identical in its syntax? |
The hyphen is the only thing that changes. So no syntax changes. |
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 am not sure what to use for a generic placeholder.
Whether to use {{N}}
or {{line_count}}
or just {{count}}
.
But 100
won't generic, What do you think @anishk85 ?
pages/common/docker-compose-logs.md
Outdated
|
||
- View only the last N lines of logs for each container: | ||
|
||
`docker compose logs {{[-n|--tail]}} {{100}}` |
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.
`docker compose logs {{[-n|--tail]}} {{100}}` | |
`docker compose logs {{[-n|--tail]}} {{line_count}}` |
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.
Co-authored-by: Harshavardhan <[email protected]>
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.
Have you tested that these commands work?
yes for sure |
Add page for docker-compose logs command to view output from containers.
If you are a new contributor to the project, do not use AI to generate pages. We will close any PR with a suspicion of AI usage.
common
,linux
,osx
,windows
,sunos
,android
, etc.