IDTSLogging.Log 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
写日志条目。
public:
void Log(System::String ^ eventName, System::String ^ computerName, System::String ^ operatorName, System::String ^ sourceName, System::String ^ sourceGuid, System::String ^ executionGuid, System::String ^ messageText, DateTime startTime, DateTime endTime, int dataCode, cli::array <System::Byte> ^ % dataBytes);
public void Log(string eventName, string computerName, string operatorName, string sourceName, string sourceGuid, string executionGuid, string messageText, DateTime startTime, DateTime endTime, int dataCode, ref byte[] dataBytes);
abstract member Log : string * string * string * string * string * string * string * DateTime * DateTime * int * Byte[] -> unit
Public Sub Log (eventName As String, computerName As String, operatorName As String, sourceName As String, sourceGuid As String, executionGuid As String, messageText As String, startTime As DateTime, endTime As DateTime, dataCode As Integer, ByRef dataBytes As Byte())
参数
- eventName
- String
事件调用日志条目。
- computerName
- String
本地计算机的名字。
- operatorName
- String
用户账户。
- sourceName
- String
事件源的对象。
- sourceGuid
- String
任务的 GUID。
- executionGuid
- String
包特定执行的GUID,用于区分同一包的多次执行。
- messageText
- String
日志里要写的文字。
- startTime
- DateTime
活动的开始时间。
- endTime
- DateTime
事件的结束时间。
- dataCode
- Int32
数值数据字段。
- dataBytes
- Byte[]
用于二进制大对象(BLOB)的字节数组字段。
注解
记录的主要方法是方法 Log 。 所有使用该方法记录的事件都会被对象过滤 LoggingOptions 。 不过,通过根据是否启用日志来设置调用 Log 条件,可以通过检查 Enabled 状态来实现,从而获得一定的性能提升。 这可以节省撰写参数和方法调用开销的时间。