Last active
December 13, 2016 13:42
-
-
Save mbentley/cf09adee495c3cadb0b01e8e138be021 to your computer and use it in GitHub Desktop.
Windows Server 2016 Docker Daemon Logs
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
| # from https://github.com/Microsoft/Virtualization-Documentation/blob/live/windows-server-container-tools/Debug-ContainerHost/Debug-ContainerHost.ps1#L175 | |
| Write-Output "Warnings & errors from the last 24 hours" | |
| $logStartTime = (Get-Date).AddHours(-24) | |
| $logNames = "Microsoft-Windows-Containers-Wcifs/Operational", | |
| "Microsoft-Windows-Containers-Wcnfs/Operational", | |
| "Microsoft-Windows-Hyper-V-Compute-Admin", | |
| "Microsoft-Windows-Hyper-V-Compute-Operational", | |
| "Application" | |
| $levels = 3,2,1,0 | |
| $providers = "Docker", "Microsoft-Windows-Hyper-V-Compute" | |
| $events = Get-WinEvent -FilterHashtable @{Logname=$logNames; StartTime=$logStartTime; Level=$levels; ProviderName=$providers} -ErrorAction Ignore | |
| $eventCsv = "logs_$((get-date).ToString("yyyyMMdd'-'HHmmss")).csv" | |
| $events | Format-Table | |
| $events | Export-CSV $eventCsv | |
| Write-Host "Logs saved to $($PWD)\$($eventCsv)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment