SSIS - How to get the detailed error when a control flow task fails


I would like to log errors when my tasks fails in the control flow. I'm using the logging system and errors are logged fine. My problem is theses errors are not enough detailed.

I have a FTP task that move sends files. When my task fails, the error logged is  "Connection manager "FTP Connection Manager" ". But when I check the Progress pane i have a more detailed error description:

Error: An error occurred in the requested FTP operation. Detailed error description: Sending file "...\Success\zmmim51_20100326_085357.cmp".
File "/.../DTS/Upload/zmmim51_20100326_085357.cmp" already exists.

This is what i want to be logged in my file.

I tried to append log in a script task, but I only have access to ErrorCode and ErrorDescription. I looked the ComponentMetaData object but it seems to be only usable in Data Flow tasks. I may be wrong.

Thanks for helping!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you using SSIS in SQL Server 2005 or 2008?
Add your code (for example Execute SQL Task or Script Task) to OnProgress and/or OnError Event.

Detailed instructions here:

best regards

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TelDigAuthor Commented:
I'm using SSIS in SQL Server 2008

I already tried this, but in the script task I only have access to ErrorCode and ErrorDescription variables. And again, when my FTP task fail or any other control flow task, I only get non-descriptive error like 'Unable to send files using "FTP Connection Manager"'.

But I know more detailed error exists because the Progress/Results pane show me what happened.
You can log these messages by using standard logging in SSIS package. Enable logging by checking executable in the Configure SSIS Logs dialog (menu SSIS --> Logging), next add log on the Providers and Logs tab, then go to the Details tab and select appropriate events (OnProgress and OnError for example). You can click Advanced button and select what columns do you want in your log.

best regards
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.