Share via


SPGlobalAdmin.Log method

NOTE: This API is now obsolete.

In Windows SharePoint Services 2.0, the Log method created an entry in the SharePoint Foundation error log, and is maintained for backward compatibility. For information about how to log errors in Windows SharePoint Services 3.0, see Trace Logs.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
<ObsoleteAttribute("This method is obsolete.", False)> _
Public Sub Log ( _
    iSeverity As Integer, _
    strMessage As String _
)
'Usage
Dim instance As SPGlobalAdmin
Dim iSeverity As Integer
Dim strMessage As String

instance.Log(iSeverity, strMessage)
[ObsoleteAttribute("This method is obsolete.", false)]
public void Log(
    int iSeverity,
    string strMessage
)

Parameters

  • iSeverity
    Type: System.Int32

    A 32-bit integer that specifies the level of severity to report in the log.

  • strMessage
    Type: System.String

    A string that contains the description used in the log for the specified severity.

Remarks

The location of the log entry depends on the context in which the method is called.

  • If the method is called from within the context of the SharePoint Foundation application pool, it typically gets logged to the %WINDOWS%\Temp\w3wpAppPoolName.log file.

  • If the method is called from within the context of your own application, it typically is logged to the %TEMP%\ApplicationName.log file. For example, if stsadm.exe internally calls the Log method, %temp%\stsadm.log is created.

The following table shows the possible values that can be passed in the iSeverity parameter.

Value

Description

0

Error.

1

Warning about a problem.

2

Ignorable but a potential problem.

3

Infrequent and happens once per thread, but only information, not a problem.

4

Uncommon and happens several times per thread, but only information, not a problem.

5

Common and happens numerous times per thread, but only information, not a problem.

6

Frequent and happens many times per thread, but only information, not a problem.

7

Verbose log that provides all information.

8

Testing program used only by test application.

You can use the SetLogThreshold method to control which messages are written to the log based on severity.

See also

Reference

SPGlobalAdmin class

SPGlobalAdmin members

Microsoft.SharePoint.Administration namespace