Export (0) Print
Expand All

LogProviderBase.CloseLog Method

Called at the end of package execution.

Namespace:  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

public virtual void CloseLog()

CloseLog is called at the end of package execution after all of the objects in the package have completed execution, or when the package terminates due to errors. When writing a custom log provider, use this method to close active connections and perform cleanup work.

The following code example demonstrates an implementation of CloseLog, which closes the file stream opened during the OpenLog method.

public override void CloseLog()
{
    if (sw != null)
    {
        sw.WriteLine("Close log" + System.DateTime.Now.ToShortTimeString());
        sw.Close();
    }
}

For more information about the variables used in this example, see the OpenLog method.

Community Additions

ADD
Show:
© 2014 Microsoft