Monitor a Log File While It Is Being Written To Using The PowerShell Tail Parameter
Share
Recently, I had a client with a process that was out of control. The logs kept getting too large, too quickly and I wasn’t able to read it with Notepad++. I know that there are many other large text file readers, but I wanted to be able to monitor log as it grew. I was on a Windows Server so this was a perfect opportunity to use the PowerShell Get-Content -Tail & -Wait parameters.
Get-Content .\example.log -Tail 5 –Wait
The -Tail 5
portion does exactly what it sounds like it does… grabs the last 5 lines of text.
The -Wait
parameter displays the next lines as they are added to the file.
This came in really handy for me and I hope it does for you too.
Author
Stewart Schatz
More Stories
Quick Tip: Determine Active Directory Account Status From The Windows Commandline
Use the following command to Determine Active Directory Account Status from the Windows Commandline without Powershell or any special software....
Where Is Java Installed?
Below are a few commands that can be run to determine where Java is installed on each Operating System: Windows:...
Windows God Mode… What!?!
Windows God Mode is a hidden feature in the Windows operating system that allows users to access all of the system’s control panel options and settings in a single place.
A Better SMTP Test
Several years ago, I posted about an SMTP Test that I was using. Well, lately, I've needed something with a...
How To Kill All Processes With The Same Name On Windows
The taskkill command can be used many different ways to end or kill running processes on Windows Server 2012 and...
How To Change The WebLogic Admin Password Using WLST
Follow the steps below to change the WebLogic Administrator's password using WLST: /u01/Oracle/Middleware/Oracle_Home/oracle_common/common/bin/wlst.sh connect('weblogic','welcome1','t3://SERVER_NAME:7001') cd('/SecurityConfiguration/DOMAIN/Realms/myrealm/AuthenticationProviders/DefaultAuthenticator') cmo.resetUserPassword('weblogic','welcome2') exit() You should now...
Average Rating