LogProvider.ConfigString Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur informasi koneksi dan konfigurasi untuk penyedia log tertentu.
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
Nilai Properti
String yang berisi status konfigurasi untuk menyimpan atau memuat.
Contoh
Contoh kode berikut memuat paket yang pengelogannya telah diaktifkan. Setelah memuat paket, LogProviders koleksi dibuat, dan setiap penyedia log dalam koleksi dijumlahkan, mencetak nilai untuk setiap properti, termasuk 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
Contoh Output:
ConfigString:
CreationName DTS. LogProviderTextFile.1
DelayValidation False
Deskripsi Menulis entri log untuk peristiwa ke file CSV
HostType LogProvider
ID {1E107E39-DB79-4F02-B8A7-61D88F2DEF63}
InnerObject System.__ComObject
Memberi nama penyedia log SSIS untuk file Teks
Keterangan
String konfigurasi berisi informasi koneksi dan konfigurasi khusus untuk penyedia. Setiap penyedia memiliki pengaturan konfigurasi yang unik untuk penyedia tersebut ConfigString , dan properti ini diatur menggunakan properti .
Tabel berikut mencantumkan penyedia log yang tersedia, deskripsinya, dan informasinya ConfigString .
Penyedia | Deskripsi | Properti ConfigString |
---|---|---|
SQL Server Profiler | Menghasilkan jejak SQL yang dapat ditangkap dan dilihat dalam SQL Server Profiler. Ekstensi nama file default untuk penyedia ini adalah .trc. | Konfigurasi tidak diperlukan. |
SQL Server | Menulis entri log peristiwa ke tabel sysssislog di database SQL Server apa pun. | penyedia SQL Server mengharuskan koneksi ke database ditentukan, dan juga nama database target. |
File Teks | Menulis entri log peristiwa ke file teks ASCII dalam format nilai yang dipisahkan koma (CSV). Ekstensi nama file default untuk penyedia ini adalah .log. | Nama manajer koneksi file. |
Log Peristiwa Windows | Log ke Log Peristiwa Windows standar pada komputer lokal di log Aplikasi. | Konfigurasi tidak diperlukan. |
XML File | Menulis entri log peristiwa ke file berformat XML. Ekstensi nama file default untuk penyedia ini .xml | Nama manajer koneksi XML. |