Add MCP_GATEWAY_LOG_DIR environment variable support for log directory configuration#148
Merged
Merged
Conversation
Collaborator
|
@copilot default logs folder should be /tmp/gh-aw/mcp-logs/ |
- Modified internal/cmd/root.go to check MCP_GATEWAY_LOG_DIR env var - Added getDefaultLogDir() helper function that returns env var value if set - Created unit test for environment variable behavior - Added integration test to verify MCP_GATEWAY_LOG_DIR works end-to-end - All existing tests pass Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for specifying log dir in dockerized mode
Add MCP_GATEWAY_LOG_DIR environment variable support for log directory configuration
Jan 11, 2026
- Changed default log directory from /tmp/gh-aw/sandbox/mcp to /tmp/gh-aw/mcp-logs - Updated internal/cmd/root.go constant - Updated internal/config/env_validation.go fallback value - Updated README.md documentation and examples - Updated AGENTS.md reference - Updated run_containerized.sh script defaults - All tests pass with new default Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Updated the default log directory to
|
pelikhan
approved these changes
Jan 11, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
MCP_GATEWAY_LOG_DIRenvironment variable was documented and used for validation in containerized mode but not actually respected by the CLI when determining the log directory.Changes
Modified
internal/cmd/root.go:getDefaultLogDir()helper that checksMCP_GATEWAY_LOG_DIRenvironment variable--log-dirflag to use environment variable as default when set/tmp/gh-aw/sandbox/mcpto/tmp/gh-aw/mcp-logsUpdated all documentation and scripts:
internal/config/env_validation.gofallback valuerun_containerized.shscript defaultsAdded tests:
getDefaultLogDir()behaviorPriority Order
Log directory is now determined by:
--log-dirflag (highest priority)MCP_GATEWAY_LOG_DIRenvironment variable/tmp/gh-aw/mcp-logsUsage
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.