Last active
September 11, 2020 22:31
-
-
Save luthermonson/08589cc189690870ac2df594d57d2236 to your computer and use it in GitHub Desktop.
Powershell to Tail Docker Logs
This file contains 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
# Make sure you setup c:\ProgramData\docker\config\daemon.json to contain log-level: debug and debug: true | |
$idx = (Get-EventLog -LogName Application -Source Docker -Newest 1).Index | |
while ($True) | |
{ | |
Start-Sleep -MilliSeconds 100 | |
$idx2 = (Get-EventLog -LogName Application -Source Docker -Newest 1).index | |
if (-NOT($idx -eq $idx2)) { | |
Get-EventLog -logname Application -Source Docker -Newest ($idx2 - $idx) | Sort index | Select-Object Message | |
} | |
$idx = $idx2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment