I have an SSIS package that has to execute a SQL Task for each file in a directory, where the volume of files is very large. This is causing a problem with logging, because every time the SQL task executes it produces the following output:
我有一个SSIS包,它必须为目录中的每个文件执行一个SQL任务,其中的文件量非常大。这导致了日志记录的问题,因为每次执行SQL任务时,它都会产生以下输出:
Multiply this by hundreds of thousands of files per day, and you get daily logs that are GBs in size. As a temporary solution, we are .rar'ing the files. This is working okay, as the repetitive data compresses well.
将它乘以每天成千上万的文件,就会得到GBs大小的日志。作为一个临时解决方案,我们正在处理文件。当重复的数据压缩得很好时,这是可以工作的。
But it would be nice if I could prevent this repetitive output all together. Is there any way to not show the output of a task in a log file unless the task fails?
但是如果我能防止这些重复的输出,那就太好了。有什么方法可以不显示日志文件中任务的输出,除非任务失败?
We are logging the task via batch like so:
我们通过批处理的方式记录任务如下:
dtexec /f "path\to\package\mypackage.dtsx" >> "path\to\log\logfile.log"
2
Change the reporting level to Errors and/or Warnings,
it's the Progress reporting that is annoying you.
将报告级别更改为错误和/或警告,使您烦恼的是进度报告。
dtexec /Reporting E /f "path\to\package\mypackage.dtsx" >> "path\to\log\logfile.log"
dtexec /Reporting W /f "path\to\package\mypackage.dtsx" >> "path\to\log\logfile.log"
dtexec /Reporting EW /f "path\to\package\mypackage.dtsx" >> "path\to\log\logfile.log"
E Errors are reported.
W Warnings are reported.报告错误。W警告报告。
https://technet.microsoft.com/en-us/library/ms162810(v=sql.105).aspx
https://technet.microsoft.com/en-us/library/ms162810(v = sql.105). aspx
If the /Reporting option is not specified then the default level is
E (errors), W (warnings), and P (progress).如果没有指定/Reporting选项,则默认级别为E(错误)、W(警告)和P(进度)。
1
You can use the flag /Reporting
with level N
(N stands for No reporting.) to prevent any status being reported to the command line console.
您可以使用第N级的标志/报告(N代表无报告)来防止向命令行控制台报告任何状态。
There are other levels like E for only Errors, W for only Warning. You can pick the choice of output that you would like to see on the console.
还有其他的级别,比如E只针对错误,W只用于警告。您可以选择您希望在控制台看到的输出。
Learn more about dtexec Utility this MSDN article.
了解更多关于dtexec实用工具的这篇MSDN文章。
dtexec /f Package.dtsx /Reporting N
dtexec /f Package.dtsx /Rep N
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2017/06/26/e847f7ce7b3369e9ace8b1c8b098b877.html。