web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / DevBeard.com / Log Tail with PowerShell

Log Tail with PowerShell

Henrik Gundersen Profile Picture Henrik Gundersen 978

I needed a way to monitor the output of the Dynamics CRM trace log file and stupidly went GoogleBing-ing for a "tail" equivalent application for Windows. I should have known to turn to trusted PowerShell!

Get the last 10 lines of a log file:

Get-Content mylogfile.log -Tail 10

Get the first 20 lines of a log file:

Get-Content mylogfile.log -Head 20

Monitor a live log file:

Get-Content mylogfile.log -Wait

Monitor a live log file but only print the last 5 lines when starting up:

Get-Content mylogfile.log -Wait -Tail 5

Remember to also use PowerShell to enable Dynamics CRM server tracing. Enjoy!


This was originally posted here.

Comments

*This post is locked for comments