How to monitor a real-time file in Windows?

2

When deploying services and applications on servers, being able to monitor the log file by viewing all updates as they occur, greatly eases this task.

On Linux, I use tail which only loads the end of the file and is therefore great for handling large files:

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

In Windows, is there any alternative to the CMD? If not, which alternative outside the CMD?

    
asked by anonymous 28.03.2017 / 14:27

3 answers

2

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

Using 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 using baretail , for having the possibility of creating color rules, so I put as a rule the word "ERROR" and turns red the line, whenever you have the floor, I recommend. In the article, Tail a Log File on Windows & Linux , you can find more alternatives.     
28.03.2017 / 14:54
1

If you want to continue using tail you can install MinGw

link

With it you can run the same command.

C:\>tail -f log.txt

    
28.03.2017 / 15:01
0

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

>powershell
>Get-Content SEU_ARQUIVO –Wait
    
28.03.2017 / 14:50