Skip to content

feat(compose): expose "Compose Logs" command configuration in settings#346

Open
SamuelJoseph23 wants to merge 2 commits into
microsoft:mainfrom
SamuelJoseph23:compose-logs-command
Open

feat(compose): expose "Compose Logs" command configuration in settings#346
SamuelJoseph23 wants to merge 2 commits into
microsoft:mainfrom
SamuelJoseph23:compose-logs-command

Conversation

@SamuelJoseph23

Copy link
Copy Markdown

Expose "Compose Logs" command configuration

Description

This Pull Request exposes the "Compose Logs" command configuration to VS Code settings. This allows users to fully customize the command template used when viewing logs for a Compose group, bringing it to parity with the existing "Container Logs" configuration.

Motivation & Context

Previously, the extension used a hardcoded command for Compose logs (logs --tail 1000 -f). This limited flexibility, particularly for Podman Compose users who often need to add the --names flag to distinguish between different containers in the log stream.

With this change, users can now define their own command templates via the containers.commands.composeLogs setting, enabling them to customize flags (e.g., adding --names or changing the --tail count) to better suit their development workflow.

How Has This Been Tested?

I have verified this change locally by:

  1. Configuring the new containers.commands.composeLogs setting in VS Code to include the --names flag.
  2. Executing the View Logs action on a running Compose group.
  3. Verifying that the terminal executed the custom command is consistent with the new setting.

Related Issue

Closes #323

Adds a new configuration setting `containers.commands.composeLogs` to allow customization of the command used for viewing Compose group logs. This enables users to pass additional flags like `--names` or adjust `--tail` via the "Compose Logs" command template, addressing limitations where Podman Compose logs lacked container names by default.

- Added `containers.commands.composeLogs` to package.json
- Implemented [selectComposeLogsCommand](cci:1://file:///c:/Users/samue/Documents/GitHub/vscode-containers/src/commands/selectCommandTemplate.ts:80:0-101:1) in command template selection
- Updated [composeGroupLogs](cci:1://file:///c:/Users/samue/Documents/GitHub/vscode-containers/src/commands/containers/composeGroup.ts:15:0-24:1) to use the configurable template

Closes microsoft#323
@SamuelJoseph23
SamuelJoseph23 requested a review from a team as a code owner January 21, 2026 07:30
@SamuelJoseph23

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@bwateratmsft bwateratmsft self-assigned this Jan 27, 2026
@bwateratmsft

Copy link
Copy Markdown
Collaborator

Apologies for how long it's taken to get to reviewing this--I haven't forgotten though!

Copilot AI review requested due to automatic review settings July 23, 2026 18:56

Copilot AI left a comment

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.

Pull request overview

Exposes a new containers.commands.composeLogs command-template setting so users can customize the command used by View Logs for Compose groups (e.g., to support Podman Compose --names), aligning Compose logs with the existing command-template model.

Changes:

  • Added a new composeLogs template command and selectComposeLogsCommand() helper to resolve and execute Compose log templates.
  • Updated Compose group “View Logs” to use the command-template pipeline instead of the orchestrator client’s logs() call.
  • Contributed the new containers.commands.composeLogs setting (schema + localized descriptions) with a default template.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
extensions/vscode-containers/src/commands/selectCommandTemplate.ts Adds composeLogs template support and a new selection helper for Compose logs.
extensions/vscode-containers/src/commands/containers/composeGroup.ts Switches Compose group logs to run via the new template selection path.
extensions/vscode-containers/package.nls.json Adds localized strings for the new composeLogs setting descriptions.
extensions/vscode-containers/package.json Contributes the containers.commands.composeLogs setting and its default template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +24
const labels = await getComposeGroupLabels(node);
const workingDirectory = labels && getComposeWorkingDirectory(labels);
let folder;
if (workingDirectory) {
folder = workspace.getWorkspaceFolder(Uri.file(workingDirectory));
}
return selectComposeLogsCommand(context, folder, options.files?.join('" -f "'), options.projectName, options.environmentFile);
"default": [
{
"label": "Compose Logs",
"template": "${composeCommand} ${configurationFile} ${projectName} logs --tail 1000 -f"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think that's reasonable since this is a compose group command

@bwateratmsft bwateratmsft left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reasonable suggestions by the robot

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Compose Logs" command in extension settings

3 participants