Finding and tailing IIS HTTP logs
Find where the logs are located for each website
Import-Module WebAdministration
foreach($WebSite in $(get-website))
{
$logFile="$($Website.logFile.directory)\w3scv$($website.id)".replace("%SystemDrive%",$env:SystemDrive)
Write-host "$($WebSite.name) [$logfile]"
}
# Results
mysite1.dev[C:\inetpub\logs\LogFiles\w3scv2]
mysite2.dev[C:\inetpub\logs\LogFiles\w3scv3]
mysite3.dev[C:\inetpub\logs\LogFiles\w3scv4]
mysite4.dev[C:\inetpub\logs\LogFiles\w3scv5]
mysite5.dev[C:\inetpub\logs\LogFiles\w3scv1]
mysite6.dev[C:\inetpub\logs\LogFiles\w3scv6]
# Let's tail the last 5 rows mysite1's log and wait for more
gc C:\inetpub\logs\LogFiles\w3scv2\u_ex180316.log -tail 5 -wait