How to monitor a file in real time on Windows?

Asked

Viewed 3,141 times

3

When deploying services and applications to servers, be able to monitor the log seeing all the updates as soon as they occur, greatly facilitates this task.

On Linux, I use Tail which only loads the end of the file, being therefore excellent to handle large files:

tail -f /usr/local/myservice/file.log

In Windows, there is some alternative to CMD?
If not, what alternative outside the CMD?

3 answers

3

Via CMD, I do not know any solution, but below some alternatives:

Using the Powershell:

Get-Content arquivo.log –Wait

If you want to make filters, we can use another concatenated command called Where:

Get-Content myTestLog.log -wait | where { $_ -match "WARNING" }


I particularly like to use the baretail, for having the possibility, to create rules of colors, so I put as a rule the word "ERROR" and turns red the line, whenever you have the word, I recommend.
In the article, Tail a Log File on Windows & Linux, can find more alternatives.

2

0

Use the command below to always monitor the last line of the file (in powershell)

>powershell
>Get-Content SEU_ARQUIVO –Wait

Browser other questions tagged

You are not signed in. Login or sign up in order to post.