Skip to content

Commit 2422594

Browse files
committed
Add --log-dir flag
1 parent a213ed9 commit 2422594

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
### Added
1616

1717
- Extra logging around the IDE spawn to help debugging.
18+
- Set `--log-dir` for debugging SSH connections. These logs go into
19+
`<data>/<domain>/logs` where `<domain>` is your Coder deployment's domain and
20+
`<data>` is `XDG_DATA_HOME` on Linux, `LOCALAPPDATA` on Windows, and
21+
`~/Library/Application Support` on macOS.
1822

1923
## 2.13.0 - 2024-07-16
2024

src/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class CoderCLIManager(
129129
val remoteBinaryURL: URL = settings.binSource(deploymentURL)
130130
val localBinaryPath: Path = settings.binPath(deploymentURL, forceDownloadToData)
131131
val coderConfigPath: Path = settings.dataDir(deploymentURL).resolve("config")
132+
val coderLogPath: Path = settings.dataDir(deploymentURL).resolve("logs")
132133

133134
/**
134135
* Download the CLI from the deployment if necessary.
@@ -262,7 +263,10 @@ class CoderCLIManager(
262263
"--stdio",
263264
if (settings.disableAutostart && feats.disableAutostart) "--disable-autostart" else null,
264265
)
265-
val proxyArgs = baseArgs + listOfNotNull(if (feats.reportWorkspaceUsage) "--usage-app=jetbrains" else null)
266+
val proxyArgs = baseArgs + listOfNotNull(
267+
"--log-dir",
268+
escape(coderLogPath.toString()),
269+
if (feats.reportWorkspaceUsage) "--usage-app=jetbrains" else null)
266270
val backgroundProxyArgs = baseArgs + listOfNotNull(if (feats.reportWorkspaceUsage) "--usage-app=disable" else null)
267271
val extraConfig =
268272
if (settings.sshConfigOptions.isNotBlank()) {
@@ -453,7 +457,6 @@ class CoderCLIManager(
453457
Features()
454458
} else {
455459
Features(
456-
// Autostart with SSH was added in 2.5.0.
457460
disableAutostart = version >= SemVer(2, 5, 0),
458461
reportWorkspaceUsage = version >= SemVer(2, 13, 0),
459462
)

0 commit comments

Comments
 (0)