Why are FireWarning and FireError working but Fire

2019-09-17 01:24发布

问题:

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?

回答1:

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