Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

According to this http://msdn.microsoft.com/en-us/library/ff512746.aspx I have to use this code WriteTrace(System.UInt32, Microsoft.SharePoint.Administration.SPDiagnosticsCategory, Microsoft.SharePoint.Administration.TraceSeverity, System.String, System.Object[]); WriteEvent(System.UInt16,Microsoft.SharePoint.Administration.SPDiagnosticsCategory,Microsoft.SharePoint.Administration.EventSeverity,System.String,System.Object[]);

However after adding that code and the using Microsoft.SharePoint.Administration; it generates compile time errors., as if those methods dont exist.

Please help

share|improve this question
    
I still have a question, the write event, writes to the event log, but what about the writetrace, where can I see that info? –  Luis Valencia Aug 22 '10 at 1:45
    
Are you running your solution in the sandbox? –  Wictor Wilen MCA MCM MVP Aug 24 '10 at 18:17
add comment

2 Answers 2

up vote 3 down vote accepted

As far as I'm aware when they are referring to the trace logs they are referring to the log files found in the LOGS folder of the 12 hive or in the case of SharePoint 2010 the 14 Hive or 'SharePoint Root'. Have a look in the latest log file for your trace message you wrote using the WriteTrace method and it should be there.

Thanks

share|improve this answer
add comment

I found how to do it using this link. http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spdiagnosticsservicebase.writetrace.aspx

However I still have a question, the write event, writes to the event log, but what about the writetrace, where can I see that info?

Thx

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.