Skip to content

Conversation

anishk85
Copy link

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.

  • The page(s) are in the correct platform directories: common, linux, osx, windows, sunos, android, etc.
  • The page description(s) have links to documentation or a homepage.
  • The page(s) follow the content guidelines.
  • The page(s) follow the style guide.
  • The PR contains at most 5 new pages.
  • The PR title conforms to the recommended templates.
  • Version of the command being documented (if known):

Add page for docker-compose logs command to view output from containers.
@github-actions github-actions bot added new command Issues requesting creation of a new page or PRs adding a new page for a command. review needed Prioritized PRs marked for reviews from maintainers. labels Oct 20, 2025
@anishk85
Copy link
Author

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.

Copy link
Collaborator

@TheRootDaemon TheRootDaemon left a 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).

@anishk85
Copy link
Author

@TheRootDaemon thanks for pointing out this issue of newer version.
My bad still on my system i uses older version.

@Managor
Copy link
Member

Managor commented Oct 21, 2025

Is the new version identical in its syntax?

@TheRootDaemon
Copy link
Collaborator

Is the new version identical in its syntax?

The hyphen is the only thing that changes. So no syntax changes.

Copy link
Collaborator

@TheRootDaemon TheRootDaemon left a 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 ?


- View only the last N lines of logs for each container:

`docker compose logs {{[-n|--tail]}} {{100}}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`docker compose logs {{[-n|--tail]}} {{100}}`
`docker compose logs {{[-n|--tail]}} {{line_count}}`

Copy link
Member

@Managor Managor Oct 21, 2025

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}}

Copy link
Author

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.

Copy link
Author

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

Copy link
Collaborator

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}}.

Copy link
Member

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.

Copy link
Member

@Managor Managor left a 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?

@anishk85
Copy link
Author

Have you tested that these commands work?

yes for sure

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

Labels

new command Issues requesting creation of a new page or PRs adding a new page for a command. review needed Prioritized PRs marked for reviews from maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants