SSIS logging template loading from Windows application

Vinod Koti 1 Reputation point
2021-01-21T08:53:42.803+00:00

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.

59121-ssis.png

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
    2021-01-21T09:42:42.097+00:00

    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:
    59059-package.png
    59060-task1.png
    59087-task2.png

    Best Regards,
    Mona

    ----------

    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.
    https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html

    0 comments No comments

  2. Vinod Koti 1 Reputation point
    2021-01-21T10:21:12.073+00:00

    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

    59136-ssislog.png

    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.

    59152-logging.png

    0 comments No comments

  3. Monalv-MSFT 5,896 Reputation points
    2021-01-22T09:30:36.89+00:00

    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.SelectedLogProviders.Add(provider)    
        p.LoggingOptions.EventFilterKind = DTSEventFilterKind.Inclusion    
        p.LoggingOptions.EventFilter = New String() {"OnPreExecute", _    
           "OnPostExecute", "OnError", "OnWarning", "OnInformation"}    
        p.LoggingMode = DTSLoggingMode.Enabled    
    

    Best Regards,
    Mona

    0 comments No comments