SSIS logging template loading from Windows application

Vinod Koti 1 Reputation point

I have customized logging events for SSIS package and saved them in a XML logging template format.
Executing DTSX package from C# application and would like to know is there a way to set the 'logging options' by application during runtime? So that i can't change and recompile the DTSX every time. Appreciate your response.


SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,470 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Monalv-MSFT 5,896 Reputation points

    Hi @Vinod Koti ,

    We should tick the package and tasks in containers and tick log name in Providers and Logs for each container when configuring ssis logs .

    Please refer to the following pictures:

    Best Regards,


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Vinod Koti 1 Reputation point

    Hi Monalv-msft

    Thanks for your reply.

    I assume my Q is not clear.

    I want to know how can i programmatically set these logging options before executing the package?

    More Info:-

    i have 25 DTSX packages. For package 1 i have set the logging options and saved those into XML format. Same way i want to set the logging options to all other 24 DTSX packages via application from where i execute the package.

    XML file


    I am unable to find what property i should use in the code. WIth this, if i need to enable more events to the log in future, i can handle programmatically by changing the log file without recompiling the packages and redeploying them.


    0 comments No comments

  3. Monalv-MSFT 5,896 Reputation points

    Hi @Vinod Koti ,

    Thanks for the detailed explanation.

    Please refer to the follwoing link and codes:

    Enabling Logging Programmatically

    Dim loggingConnection As ConnectionManager = p.Connections.Add("FILE")    
        loggingConnection.ConnectionString = "C:\SSISPackageLog.txt"    
        Dim provider As LogProvider = p.LogProviders.Add("DTS.LogProviderTextFile.2")    
        provider.ConfigString = loggingConnection.Name    
        p.LoggingOptions.EventFilterKind = DTSEventFilterKind.Inclusion    
        p.LoggingOptions.EventFilter = New String() {"OnPreExecute", _    
           "OnPostExecute", "OnError", "OnWarning", "OnInformation"}    
        p.LoggingMode = DTSLoggingMode.Enabled    

    Best Regards,

    0 comments No comments