简体   繁体   English

执行后/执行期间,如何从ASP NET检索SSIS包日志? (C#)

[英]How do I retrieve SSIS package logging from ASP NET after/during execution? (C#)

I am executing an SSIS package from an ASP NET web form. 我正在从ASP NET Web表单执行SSIS包。

How can I programmatically obtain the actually logging information, rather than the basic execution "Success" or "Failed" execution results when I am using the execution procedure below? 当我使用以下执行过程时,如何以编程方式获取实际的日志记录信息,而不是基本的执行结果“成功”或“失败”?

myPackage = app.LoadPackage(packageLocation, null);
myPackage.Execute()

I am aware of the basic package execution result (shown below) but I want more details, similar to the log files obtainable through SSIS debugging. 我知道基本的包执行结果(如下所示),但是我想要更多详细信息,类似于通过SSIS调试可获得的日志文件。

 DTSExecResult myResult = myPackage.Execute();
 lblStatus.Text = "Package result: " + myResult.ToString();

You should be able to accomplish this using some of the logging methods available to the SSIS package itself in Microsoft.SqlServer.Dts.Runtime.Package . 您应该能够使用Microsoft.SqlServer.Dts.Runtime.Package SSIS包本身可用的某些日志记录方法来完成此操作。

Specifically you should be able to reference DtsContainer.LogEntryInfos for the package in order to view all of the associated log entries. 具体来说,您应该能够为该程序包引用DtsContainer.LogEntryInfos ,以便查看所有关联的日志条目。 In your case this woudl be deletePkg . 在您的情况下, deletePkg

我不知道实时获取它的任何方法,但是您可能正在登录到表或文件,因此可以通过对表的SQL查询或文件的文件流来检索日志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM