16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Log Method<br />

Chapter 33: The Windows SharePoint Services Object Model 929<br />

This code example will show how to create a log with the Log method of the<br />

SPGlobalAdmin class that indicates the severity of a problem in the Windows Share-<br />

Point Services environment <strong>and</strong> provides details. The signature of the Log method<br />

looks like this:<br />

public void Log(<br />

int iSeverity,<br />

string strMessage<br />

);<br />

The iSeverity parameter specifies the level of severity to report in the log.<br />

Table 33-3 shows the possible values that the iSeverity parameter can contain.<br />

Table 33-3 Values of the iSeverity Parameter<br />

Value Description<br />

0 Error<br />

1 Warning about a problem<br />

2 Ignorable but a potential problem<br />

3 Infrequent <strong>and</strong> happens once per thread, but only information, not a problem<br />

4 Uncommon <strong>and</strong> happens several times per thread, but only information, not a problem<br />

5 Common <strong>and</strong> happens numerous times per thread, but only information, not a problem<br />

6 Frequent <strong>and</strong> happens many times per thread, but only information, not a problem<br />

7 Verbose log that provides all information<br />

8 TestingProgram only used by test application<br />

The strMessage parameter contains a description that will be used in the log for<br />

the specified error. The Log method will log the message <strong>and</strong> severity to a file in<br />

%temp%\.log.<br />

SPGlobalAdmin myGlobalAdmin = new SPGlobalAdmin();<br />

myGlobalAdmin.Log(8, "a test message");<br />

<strong>Microsoft</strong>.SharePoint.Dsp Namespace<br />

The <strong>Microsoft</strong>.SharePoint.Dsp namespace provides the base class for the data<br />

retrieval service adapters used in <strong>Microsoft</strong> Windows SharePoint Services. This<br />

namespace can be found in the <strong>Microsoft</strong>.SharePoint.Dsp assembly (in <strong>Microsoft</strong><br />

.SharePoint.Dsp.dll). The adapters define a protocol for data consumers to query<br />

heterogeneous data sources <strong>and</strong> for the data sources to return query results back to<br />

the consumers, integrating different types of data into a unified format so that they<br />

can be related, analyzed, <strong>and</strong> manipulated easily.<br />

Each data retrieval service provides a data-binding scheme that enables data<br />

consumers <strong>and</strong> data servers to communicate with each other through Simple Object

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!