Enhance error logging in log monitoring by capturing full exception details

This commit is contained in:
Göran Sander
2025-09-29 10:47:19 +02:00
parent eededb3eba
commit edc6d68d14

View File

@@ -188,12 +188,15 @@ jobs:
}
} catch {
$errorMsg = $_.Exception.Message
$stackTrace = $_.Exception.StackTrace
Write-Host ("❌ Failed to check log files: " + $errorMsg) -ForegroundColor Red
Write-Host ("Stack trace: " + $stackTrace) -ForegroundColor Red
Write-Host ("::error::Log monitoring failed - " + $errorMsg)
exit 1
# Log FULL exception details for debugging
Write-Host ("Full exception: " + $_.Exception.ToString()) -ForegroundColor Red
$errorMsg = $_.Exception.Message
$stack = $_.Exception.StackTrace
Write-Host ("❌ Failed to check log files: " + $errorMsg) -ForegroundColor Red
Write-Host ("Stack trace: " + $stack) -ForegroundColor Red
Write-Host ("::error::Log monitoring failed - " + $errorMsg)
exit 1
}
- name: Stop Butler SOS service if errors found