SPGlobalAdmin.Log 方法

请注意:此 API 现在已过时。

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.

命名空间:  Microsoft.SharePoint.Administration
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
<ObsoleteAttribute("This method is obsolete.", False)> _
Public Sub Log ( _
    iSeverity As Integer, _
    strMessage As String _
)
用法
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
)

参数

  • iSeverity
    类型:System.Int32

    指定在日志中报告的严重程度 32 位整数。

  • strMessage
    类型:System.String

    一个字符串,包含在日志中用于指定严重级别的说明。

备注

日志条目的位置取决于在其中调用该方法的上下文。

  • 如果从SharePoint Foundation应用程序池的上下文中,调用该方法,它通常获取记录到%WINDOWS%\Temp\w3wpAppPoolName.log文件。

  • 如果该方法从您自己的应用程序的上下文中调用的它通常被记录到%TEMP%\ApplicationName.log文件。例如,如果 stsadm.exe 内部调用Log方法时,将创建%temp%\stsadm.log 。

下表显示iSeverity参数中可以传递的可能值。

说明

0

错误。

1

有关的问题的警告。

2

可忽略的值,但可能会出现问题。

3

非频繁和发生一次,每个线程,但仅信息、 不是问题。

4

不常用和每个线程,但仅信息、 不是问题发生多次。

5

通用和每个线程,但仅信息、 不是问题发生多次。

6

常用和每个线程,但仅信息、 不是问题发生次数。

7

提供所有信息的详细日志。

8

仅由测试应用程序使用的测试程序。

您可以使用的控件的消息写入日志基于严重性SetLogThreshold方法。

另请参阅

引用

SPGlobalAdmin 类

SPGlobalAdmin 成员

Microsoft.SharePoint.Administration 命名空间