Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
update collect-windows-logs.ps1 to grab azure-cni logs from system32
Browse files Browse the repository at this point in the history
  • Loading branch information
marosset committed Jan 12, 2021
1 parent 291b31a commit 62484dc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/collect-windows-logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ $lockedFiles | Foreach-Object {
}
}

# azure-cni logs currently end up in system32 when called by containerd so check there for logs too
$lockedTemp = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName())
New-Item -Type Directory $lockedTemp
$lockedFiles | Foreach-Object {
Write-Host "Copying $_ to temp"
$src = "c:\windows\system32\$_"
if (Test-Path $src) {
$tempfile = Copy-Item $src $lockedTemp -Passthru -ErrorAction Ignore
if ($tempFile) {
$paths += $tempFile
}
}
}

# Containerd log is outside the c:\k folder
$containerd = "C:\ProgramData\containerd\root\panic.log"
if (Test-Path $containerd) {
Expand Down

0 comments on commit 62484dc

Please sign in to comment.