It’s possible to force a new uls log to be created by running new-splogfile. This will end the current log file and start a new one. This is valuable when attempting to reproduce a problem and want to minimize the total size of the log file. Merge-SPLogFile combines trace log entries from all farm computers into a single log file on the local computer. It does this by creating a one-time timer job and executing it to create the merged log. This is extremely valuable if you are tracking an issue and suspect it’s hitting multiple servers in a farm. Since the conversation across multiple servers will contain the exact same correlation ID, the merge-splogfile becomes a powerful cmdlet for troubleshooting.
Some examples of Merge-SPLogFile:
Merge-SPLogFile -Path “C:\Logs\FarmMergedLog.log” -Overwrite
The preceding example merges the last hour of log data from all farm computers with no filtering.
Merge-SPLogFile -Path “C:\Logs\FarmMergedLog.log” -Overwrite -Area Search
The preceding example merges the last hour of log data from the Search area
Additional parameters are available to tune results. For Example, looking for something specific in the ULS message you can filter results using the Message parameter.
Mining ULS Logs via PowerShell
It’s possible to view ULS log entries using the Get-SPLogEvent cmdlet. At beta 2, Running this cmdlet by itself retrieves every event from every ULS log within the directory hosting ULS logs. Some examples of running Get-SPLogEvent:
Example 1: ULS log or logs are moved to a different directory named “newpath”, run the following:
Get-SPLogEvent –Directory “C:\newpath”
No hay comentarios:
Publicar un comentario