Facts About SharePoint Log and Correlation ID
Facts :
1- GUID attached to your logs/error messages when something happens.
2- Correlation ID is used per request-session.
3- You can find the Log files inside
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS\
How To Search Inside SharePoint Log:
1- Using Power Shell :
Short Description
get-splogevent | ?{$_Correlation -eq "<GUID>"}
Details
get-splogevent | ?{$_.Correlation -eq "<GUID>"} | select Area, Category, Level, EventID, Message | Format-List
If you want the Error Detail to be put into a text or log file instead :
get-splogevent | ?{$_.Correlation -eq "<GUID>"} | select Area, Category, Level, EventID, Message | Format-List > C:MyErr.log
2- Using SQL queries :
In your logging DB (usually called WSS_Logging and could be called something else)
there is a view called "ULSTraceLog" which you can query :
select [RowCreatedTime], [ProcessName], [Area], [Category], EventID, [Message]
from [WSS_UsageApplication].[dbo].[ULSTraceLog]
where CorrelationId= 'C5CCAM46-38h9-5B5D-BN44-5242B8C3M2M3'
3- Get the current Correlation ID by using code :
[DllImport ("advapi32.dll")]
public static extern uint EventActivityIdControl(uint controlCode,ref Guid activityId);
public const uint EVENT_ACTIVITY_CTRL_GET_ID = 1;
public static Guid GetMyCurrentCorrelationID()
{
Guid g = Guid .Empty;
EventActivityIdControl(EVENT_ACTIVITY_CTRL_GET_ID, ref g);
return g;
}
naadydev@gmail.com
No comments:
Post a Comment