LoggingOptions.EventFilterKind 属性

定义

获取或设置一个值,该值说明设置的事件筛选器的类型(包含还是排除)。

public:
 property Microsoft::SqlServer::Dts::Runtime::DTSEventFilterKind EventFilterKind { Microsoft::SqlServer::Dts::Runtime::DTSEventFilterKind get(); void set(Microsoft::SqlServer::Dts::Runtime::DTSEventFilterKind value); };
public Microsoft.SqlServer.Dts.Runtime.DTSEventFilterKind EventFilterKind { get; set; }
member this.EventFilterKind : Microsoft.SqlServer.Dts.Runtime.DTSEventFilterKind with get, set
Public Property EventFilterKind As DTSEventFilterKind

属性值

一个来自 DTSEventFilterKind 枚举的值,该值指示是在事件日志中包括还是排除添加到 EventFilter 的事件。

示例

下面的代码示例启用对包的日志记录,添加日志提供程序,然后显示默认值 EventFilterKindDTSEventFilterKind使用枚举时,将更改默认值。

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace Microsoft.SqlServer.SSIS.Sample  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Package pkg = new Package();  
            pkg.LoggingMode = DTSLoggingMode.Enabled;  
            LogProvider log1 = pkg.LogProviders.Add("DTS.LogProviderTextFile.1");  
            pkg.LoggingOptions.SelectedLogProviders.Add(log1);  
            LoggingOptions lOpts = pkg.LoggingOptions;  
            Console.WriteLine("EventFilterKind: {0}", pkg.LoggingOptions.EventFilterKind.ToString());  

            pkg.LoggingOptions.EventFilterKind = DTSEventFilterKind.Inclusion;  
            Console.WriteLine("EventFilterKind: {0}", pkg.LoggingOptions.EventFilterKind.ToString());  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Microsoft.SqlServer.SSIS.Sample  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim pkg As Package =  New Package()   
            pkg.LoggingMode = DTSLoggingMode.Enabled  
            Dim log1 As LogProvider =  pkg.LogProviders.Add("DTS.LogProviderTextFile.1")   
            pkg.LoggingOptions.SelectedLogProviders.Add(log1)  
            Dim lOpts As LoggingOptions =  pkg.LoggingOptions   
            Console.WriteLine("EventFilterKind: {0}", pkg.LoggingOptions.EventFilterKind.ToString())  

            pkg.LoggingOptions.EventFilterKind = DTSEventFilterKind.Inclusion  
            Console.WriteLine("EventFilterKind: {0}", pkg.LoggingOptions.EventFilterKind.ToString())  
        End Sub  
    End Class  
End Namespace  

示例输出:

EventFilterKind:排除

EventFilterKind:包含

注解

有关详细信息,请参阅 以编程方式启用日志记录

适用于