Logging in SSIS (SQL Server Log Provider)

ssis logging sql


In this post we are gonna discuss about how to LOG the Package info in Sql Server table. Thanks Swathi for a very good documentation work you have done.

SQL Server Integration Services includes log providers that you can use to implement logging of packages, containers, and tasks. With logging, you can capture run-time information about a package, helping you audit and troubleshoot a package every time it is run. For example, a log can capture the name of the operator who ran the package and the time the package began and finished. Let’s see an example for Logging in SSIS here.

Let’s start with how to open Logging wizard. There are two places from where you can launch the logging wizard. Firstly, right click on anywhere in the package there will be an option called Logging click on that. Secondly, You can go to the top menu and from where you can select SSIS and inside that you find an option for Logging.

Now select Logging option, it will open the Logging Wizard.

Here you can see Containers on the left hand side which the packages ,task and containers that are available and for that you can create a log. Logs are associated with packages and are configured at the package level. Each task or container in a package can log information to any package log. The tasks and containers in a package can be enabled for logging even if the package itself is not. For example, you can enable logging on an Execute SQL task without enabling logging on the parent package. A package, container, or task can write to multiple logs. You can enable logging on the package only, or you can choose to enable logging on any individual task or container that the package includes.

On right hand side you see Provider and Logs means where you want to log and another one is Details means what you want to log. Will see both the tab one by one .Let’s start with Provider and Logs tab and in that Provider Type. It has Five provider type, Here will discuss SSIS log provider for SQL Server.

Now Select SSIS log provider for SQL Server and select Add.

Create a connection to your database where you want to log. Here point to notice is u just need to create a connection no need to create a table inside that, while logging it will create a table called Sysssislog by its own. Here I am creating a connection to my localhost server and selecting my AdventureworkDatabaseDW database.

Now, As explained above you can create logs at any level I mean at package level , container level , as well as at task host level. Here is my package I am using.

It has one package and into that it has three task Execute SQL Task ,For Each loop Container and File System Task. I want to create logging at File system Task level.

So I select the file system task from the container list and then check the SSIS Log provider for SQL server which I just added. Now I Select the Details tab on the top at right hand side. It shows that what are the information you want to know and want to write to your log provider.

You select all the option or the only those which you want to show. In my case I will check all of them. There is one more option at the bottom called Advanced. In advanced u can see more details.

Now select OK and we are good to go. Execute the package and if my package failed it will log all the information in the SQL server database what I provided. So lets Execute.

As you see my Package got failed so there must be a table created in Database which I provided in the connection. Let’s check that in Sql server management Studio. I go to the SSMS and select my database AdventureWorksDW2008R2 and as I told you erlier in this post, a table with the name SYSSSISLOG will be created and let’s check the same.
Select * from sysssislog

You can see it showing all the information about the task that failed and related information.

So, here your table that contains all the log information you needed.

Roopesh Babu V


Please enter your comment!
Please enter your name here

− 2 = 3