Skip to content

Debug logs are not shown when running server in background #2938

@eleftherias

Description

@eleftherias

Bug

When running an MCP server in the background with the --debug flags, the debug logs are not shown for the entire lifecycle of the server.

To reproduce

Run the server with debug enabled:
thv run mcp-spec --name mcp-test --debug

Check the logs (this is the mac location, use the appropriate path for your OS):
cat ~/Library/Application\ Support/toolhive/logs/mcp-test.log

Expected: some DEBUG logs are shown
Actual: no DEBUG logs are shown

Fix

Pass the --debug flag in RunWorkloadDetached if the the debug flag is true in the runconfig.

Alternatives considered

The alternative is to have thv restart read the debug flag from the runconfig and set it accordingly.
The issue with this approach is that thv restart also has a --debug flag, which should override the debug flag in the runconfig.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions