为什么FireWarning和FireError可以正常工作,而FireInformation却不能正常工作? [英] Why are FireWarning and FireError working but FireInformation is not?

查看:74
本文介绍了为什么FireWarning和FireError可以正常工作,而FireInformation却不能正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.bat脚本,该脚本通过dtexec调用SSIS包并将输出重定向到日志文件:

调用dtexec.exe/f Package.dtsx>>logfile.txt

我们没有在包中配置单独的日志记录,因为以这种方式捕获了发送到标准输出的任何内容.通常这足够了,但是我现在尝试使用 Dts.Events.FireInformation 编写一些自定义日志消息.但是,这些消息根本不会显示在输出中.

如果我使用 FireWarning FireError ,则两者都会按预期方式出现在日志中,因此我猜测这是一些日志记录级别的配置,但是我无法找到更改它的选项.

这不是调试信息,也不是警告或错误-它们是有关当前处理的有用消息.为什么不能正常工作,我该如何解决?

还是有更好的方法来写标准输出?

解决方案

我怀疑如果将呼叫更改为类似内容,是否可以解决问题?

  CALL dtexec.exe/f Package.dtsx/rep EWI>>logfile.txt 

这将记录错误,警告和信息事件,这些事件在没有明确请求的情况下不会显示信息.有关更多信息,请参见 dtexec >

I've got a .bat script that calls an SSIS package via dtexec and redirects the output to a log file:

CALL dtexec.exe /f Package.dtsx >> logfile.txt

We don't have separate logging configured within the package since anything sent to standard out is captured in this way. This is usually enough but I'm now trying to write some custom log messages using Dts.Events.FireInformation. However, these messages are not showing up in the output at all.

If I use FireWarning or FireError then both appear in the log as expected, so I'm guessing this is some configuration of logging levels, but I can't find an option to change it.

This isn't debug information but nor is it a warning or an error - they're useful messages regarding the current processing. Why doesn't this work and how can I fix it?

Or is there a better way to write to standard out?

解决方案

I suspect that if you change your call to something like, does it solve the issue?

CALL dtexec.exe /f Package.dtsx /rep EWI >> logfile.txt

This logs the Error, Warning and Information events which without an explicit request, doesn't surface the Information. See dtexec for more info

这篇关于为什么FireWarning和FireError可以正常工作,而FireInformation却不能正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆