How to write custom message in SSIS logging's event handler

Kalpana 291 Reputation points
2020-11-12T17:38:08.067+00:00

Hi

I am trying to create a SSIS Package. I am using the SSIS logging feature which has the event handler. I would need to format and write a custom message into the text file.
The package logs into a text file.

Currently, without any modification and only by selecting the OnPreExecute, this is the format of the log. I would want to change the way the log contents are generated :-

Fields: event,computer,operator,source,sourceid,executionid,starttime,endtime,datacode,databytes,message

PackageStart,IT830G6,DO\kalpana,Package,{8D3D0515-10C2-43FC-88DF-6ABFF4397F8A},{E099C05B-555A-4A16-8914-4F6AA80BAF35},13/11/2020 1:22:22 AM,13/11/2020 1:22:22 AM,0,0x,Beginning of package execution.

OnPreExecute,IT830G6,DO\kalpana,Package,{8D3D0515-10C2-43FC-88DF-6ABFF4397F8A},{E099C05B-555A-4A16-8914-4F6AA80BAF35},13/11/2020 1:22:22 AM,13/11/2020 1:22:22 AM,0,0x,

How can I format the contents of the log so that it appears this way.

13/11/2020 1:22:22 AM - OnPreExecute - Package Started'

How can I achieve this. Thank you.

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

1 answer

Sort by: Most helpful
  1. Monalv-MSFT 5,896 Reputation points
    2020-11-16T02:41:47.063+00:00

    Hi @Kalpana ,

    Please use Script Task to edit the custom logging.

    SQL Server Integration Services provides a rich set of custom events for writing log entries for packages and many tasks. You can use these entries to save detailed information about execution progress, results, and problems by recording predefined events or user-defined messages for later analysis.

    The custom log entries are a different set of entries than the set of standard logging events that are available for packages and all containers and tasks. The custom log entries are tailored to capture useful information about a specific task in a package.

    The following links will be helpful:

    1. Custom Messages for Logging
    2. How to Add Custom Logging to SSIS Package

    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.
    Hot issues in November--What can I do if my transaction log is full?
    Hot issues in November--How to convert Profiler trace into a SQL Server table?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.