Tail Logs using Powershell
Quote from moshe on 20/10/2020, 7:24 am
- Created by Kobbi Gal on Jun 01, 2018
Problem
Tailing is to be able to read the logs as they are written. This method is mainly used in Linux terminals but PowerShell has a built in functionality that resembles it. In certain cases, user would like to debug the issue with whichever process in a live manner rather than wait for the log to finish writing.
Example
Tailing processes such as installation can really help understand which phase of the installation was taking long and where the issue lies.
Solution
Basic Tail
Get-Content {filename} -Wait
With Options
Get-Content .\Application.log -Tail 2 -Wait | Select-String "ERROR"
- Created by Kobbi Gal on Jun 01, 2018
Problem
Tailing is to be able to read the logs as they are written. This method is mainly used in Linux terminals but PowerShell has a built in functionality that resembles it. In certain cases, user would like to debug the issue with whichever process in a live manner rather than wait for the log to finish writing.
Example
Tailing processes such as installation can really help understand which phase of the installation was taking long and where the issue lies.
Solution
Basic Tail
Get-Content {filename} -Wait
With Options
Get-Content .\Application.log -Tail 2 -Wait | Select-String "ERROR"