DTSLoggingMode 枚举

定义

指定容器的日志记录行为。 容器可以启用日志记录、禁用日志记录,或指定要使用的设置是在父容器中找到的设置。

public enum class DTSLoggingMode
public enum DTSLoggingMode
type DTSLoggingMode = 
Public Enum DTSLoggingMode
继承
DTSLoggingMode

字段

Disabled 2

禁用日志记录。

Enabled 1

启用日志记录。

UseParentSetting 0

日志记录值取自父容器的日志记录模式设置。

示例

下面的代码示例演示如何使用此枚举设置包的日志记录模式。

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

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Package pkg = new Package();  
            // The packages is assigned the following default value.  
            Console.WriteLine("Default LoggingMode: {0}", pkg.LoggingMode);  

            // Modify the default value.  
            pkg.LoggingMode = DTSLoggingMode.Disabled;  
            Console.WriteLine("New LoggingMode:     {0}", pkg.LoggingMode);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim pkg As Package =  New Package()   
            ' The packages is assigned the following default value.  
            Console.WriteLine("Default LoggingMode: {0}", pkg.LoggingMode)  

            ' Modify the default value.  
            pkg.LoggingMode = DTSLoggingMode.Disabled  
            Console.WriteLine("New LoggingMode:     {0}", pkg.LoggingMode)  
        End Sub  
    End Class  
End Namespace  

示例输出:

默认 LoggingMode:UseParentSetting

新建 LoggingMode:已禁用

注解

具有属性的对象 LoggingMode 使用此枚举。 The LoggingMode property is initially defined in the DtsContainer, and eventually inherited by containers such as the Package, Sequence, and other containers.

适用于