LogProviderBase.Log 메서드

정의

패키지를 실행하는 동안 런타임 이벤트가 발생할 때 호출됩니다.

public:
 virtual void Log(System::String ^ logEntryName, System::String ^ computerName, System::String ^ operatorName, System::String ^ sourceName, System::String ^ sourceID, System::String ^ executionID, System::String ^ messageText, DateTime startTime, DateTime endTime, int dataCode, cli::array <System::Byte> ^ dataBytes);
public virtual void Log (string logEntryName, string computerName, string operatorName, string sourceName, string sourceID, string executionID, string messageText, DateTime startTime, DateTime endTime, int dataCode, byte[] dataBytes);
abstract member Log : string * string * string * string * string * string * string * DateTime * DateTime * int * byte[] -> unit
override this.Log : string * string * string * string * string * string * string * DateTime * DateTime * int * byte[] -> unit
Public Overridable Sub Log (logEntryName As String, computerName As String, operatorName As String, sourceName As String, sourceID As String, executionID As String, messageText As String, startTime As DateTime, endTime As DateTime, dataCode As Integer, dataBytes As Byte())

매개 변수

logEntryName
String

이벤트의 이름입니다.

computerName
String

패키지가 실행되고 있는 컴퓨터의 이름입니다.

operatorName
String

패키지를 실행하는 사용자 계정입니다.

sourceName
String

이벤트를 발생시키는 개체의 이름입니다.

sourceID
String

이벤트를 발생시키는 개체의 ID입니다.

executionID
String

실행 중인 패키지의 실행 ID입니다.

messageText
String

이벤트의 텍스트 메시지입니다.

startTime
DateTime

이 이벤트를 일으킨 동작의 시작 시간입니다.

endTime
DateTime

이 이벤트를 일으킨 동작의 종료 시간입니다.

dataCode
Int32

숫자 데이터 필드입니다.

dataBytes
Byte[]

BLOB 데이터 필드입니다.

예제

Log 메서드는 패키지의 개체가 이벤트 인터페이스 중 하나에서 FireEvent 메서드를 호출하여 이벤트를 발생시킵니다. 여러 이벤트 인터페이스가 있으며, 각 인터페이스에는 인터페이스에 정의된 이벤트의 하위 집합이 IDTSEvents 포함될 수 있습니다. 이 인터페이스에는 FireCustomEvent 사용자 지정 이벤트가 있는 개체가 이벤트를 발생시키는 데 사용하는 이벤트인 메서드가 포함되어 있습니다.

다음 코드 예에서는 Log 메서드를 구현하고 이전 섹션에서 연 스트림에 이벤트를 기록합니다.

public override void Log(string logEntryName, string computerName, string operatorName, string sourceName, string sourceID, string executionID, string messageText, DateTime startTime, DateTime endTime, int dataCode, byte[] dataBytes)  
{  
    sw.Write(logEntryName + ",");  
    sw.Write(computerName + ",");  
    sw.Write(operatorName + ",");  
    sw.Write(sourceName + ",");  
    sw.Write(sourceID + ",");  
    sw.Write(messageText + ",");  
    sw.Write(dataBytes + ",");  
    sw.WriteLine("");  
}  
Public Overrides  Sub Log(ByVal logEnTryName As String, ByVal computerName As String, ByVal operatorName As String, ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, ByVal startTime As DateTime, ByVal endTime As DateTime, ByVal dataCode As Integer, ByVal dataBytes() As Byte)  
    sw.Write(logEnTryName + ",")  
    sw.Write(computerName + ",")  
    sw.Write(operatorName + ",")  
    sw.Write(sourceName + ",")  
    sw.Write(sourceID + ",")  
    sw.Write(messageText + ",")  
    sw.Write(dataBytes + ",")  
    sw.WriteLine("")  
End Sub  

설명

이 메서드는 또는 IDTSInfoEvents 인터페이스에서 IDTSEvents 이벤트가 발생할 때 호출 됩니다.

이 메서드를 사용하여 패키지가 실행됨에 따라 로그 항목을 작성합니다.

이 메서드의 매개 변수는 이벤트가 시작된 시기, 이벤트를 발생시킨 개체 등에 대한 정보를 제공합니다.

적용 대상