Scenario/Problem: You need to trace an issue but don’t want to have to review the logs on each server in the farm.
Solution: Use the Merge-SPLogFile
cmdlet.
The Merge-SPLogFile
cmdlet is a wonderful process that consolidates the logs from all servers in the farm into one log file. This makes tracing and finding issues easier. Listing 4.14 shows a sample command line.
Merge-SPLogFile -Path E:LogsMergedLog.log -StartTime "1/19/2013"
-Overwrite
The Path
parameter is the path and filename of the log file you want to create. If it already exists, the cmdlet will fail unless you include the Overwrite
switch parameter. You should use the StartTime
parameter (and/or the EndTime
parameter) to specify the range of the log entries to gather and merge.
Several other parameters can help you narrow the log search:
• Area
• Category
• ContextFilter
• Correlation
• Level
• EventID
• Message
• Process
• ThreadID
18.224.59.231