2

How can I log from within an SSIS Script Component?

I am using the below code, which I believe should work.

public override void PreExecute()
{
    this.Log("Entering PreExecute()", 0, new byte[0]);
    base.PreExecute();
}

public override void PostExecute()
{
    this.Log("Entering PostExecute()", 0, new byte[0]);
    base.PostExecute();
}

I followed the Ninja clicking method in SSIS Logging to get the below logging working for a Script Task in the same SSIS Package.

public void Main()
{
    Dts.Log("Entering Main", 0, new byte[0]);
    Dts.TaskResult = (int)ScriptResults.Success;
}

I believe that I have SSIS Logging configured correctly since I see the "Entering Main" log entry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.