语言

LogProvider.ConfigString 属性

定义

获取或设置特定日志提供者的连接和配置信息。

public:
 property System::String ^ ConfigString { System::String ^ get(); void set(System::String ^ value); };
public string ConfigString { get; set; }
member this.ConfigString : string with get, set
Public Property ConfigString As String

属性值

一个包含配置状态的字符串,用于保存或加载。

示例

以下代码示例加载了一个已启用日志的包。 加载包后, LogProviders 创建集合,集合中的每个日志提供者被枚举,打印每个属性的值,包括 ConfigString

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

namespace LogProvider_Properties_Test  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            // The package is one of the SSIS samples,  
            // modified to log information to the "SSIS  
            // log provider for Text files".  
            string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";  
            // Create the Application, and load the sample.  
            Application app = new Application();  
            Package pkg = app.LoadPackage(mySample, null);  

            // Get the LogProviders collection from the package.  
            LogProviders logProvs = pkg.LogProviders;  
            foreach (LogProvider logProv in logProvs)  
            {  
                Console.WriteLine("ConfigString:   {0}", logProv.ConfigString);  
                Console.WriteLine("CreationName    {0}", logProv.CreationName);  
                Console.WriteLine("DelayValidation {0}", logProv.DelayValidation);  
                Console.WriteLine("Description     {0}", logProv.Description);  
                Console.WriteLine("HostType        {0}", logProv.HostType);  
                Console.WriteLine("ID              {0}", logProv.ID);  
                Console.WriteLine("InnerObject     {0}", logProv.InnerObject);  
                Console.WriteLine("Name            {0}", logProv.Name);  
             }  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.SqlServer.Dts.Tasks.DMQueryTask  

Namespace LogProvider_Properties_Test  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            ' The package is one of the SSIS samples,  
            ' modified to log information to the "SSIS  
            ' log provider for Text files".  
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx"   
            ' Create the Application, and load the sample.  
            Dim app As Application =  New Application()   
            Dim pkg As Package =  app.LoadPackage(mySample,Nothing)   

            ' Get the LogProviders collection from the package.  
            Dim logProvs As LogProviders =  pkg.LogProviders   
            Dim logProv As LogProvider  
            For Each logProv In logProvs  
                Console.WriteLine("ConfigString:   {0}", logProv.ConfigString)  
                Console.WriteLine("CreationName    {0}", logProv.CreationName)  
                Console.WriteLine("DelayValidation {0}", logProv.DelayValidation)  
                Console.WriteLine("Description     {0}", logProv.Description)  
                Console.WriteLine("HostType        {0}", logProv.HostType)  
                Console.WriteLine("ID              {0}", logProv.ID)  
                Console.WriteLine("InnerObject     {0}", logProv.InnerObject)  
                Console.WriteLine("Name            {0}", logProv.Name)  
            Next  
        End Sub  
    End Class  
End Namespace  

示例输出:

配置字符串:

CreationName DTS。LogProviderTextFile.1

延迟验证错误

描述 将事件日志写入CSV文件

HostType LogProvider

ID {1E107E39-DB79-4F02-B8A7-61D88F2DEF63}

内在物体System.__ComObject

文本文件的SSIS日志命名提供者

注解

配置字符串包含提供者特定的连接和配置信息。 每个提供者都有该提供者独一无二的配置设置,这些属性都是通过该 ConfigString 属性设置的。

下表列出了可用的日志提供者、它们的描述及其 ConfigString 信息。

Provider Description ConfigString 属性
SQL Server Profiler 生成可被捕获并在 SQL Server Profiler 中查看的 SQL 跟踪。 这种提供程序的默认文件扩展名是 .trc。 无需配置。
SQL Server 将事件日志条目写入任何 SQL Server 数据库中的 sysssislog 表。 SQL Server 提供者要求指定与数据库的连接以及目标数据库名称。
文本文件 以逗号分隔值(CSV)格式写入事件日志条目到 ASCII 文本文件。 这种提供程序的默认文件扩展名是 .log。 一个文件连接管理器的名字。
Windows 事件日志 日志记录到本地计算机的标准 Windows 事件日志,存于应用程序日志中。 无需配置。
XML 文件 将事件日志写入XML格式文件。 该提供商的默认文件扩展名为 .xml XML连接管理器的名称。

适用于