SSIS - Create Log File for SSIS Package Execution With DateTime [ SSIS Logging ]


We have created a SSIS Package. Now we want to enable Logging for our Package and want to create a log file ( Text File Logging) each time the package executes. The Log file name should look like "PackageName_Date_Time.log".


SSIS provides different types of logging such as 
  • Text File Logging
  • SQL Server Profiler
  • SQL Server
  • Windows Event Log
  • XML File
For more details please visit 

In our case we will be using Text File Logging. Let's start

Step 1: 
You can go to SSIS menu and then choose Logging Or right click inside Control Flow Pane and choose Logging as shown below


Step 2: 
Choose the Log provider, In our case we are using Text File Logging

Step 3: 
Create Connection for Log file as shown below

Step 4: 
Choose the containers , Tasks for which you want to enable logging

Step 5: 
Choose the events for each of the task or container you want to save in log file. For more details about events visit the link that I provided in Solution section

Step 6: 
If we run our package now, it is going to create a log file on desktop for us with the name MylogFile.txt. But our goal is not to generate a log file like that. We want to create a log file in PackageLogFiles Folder with PackageName and Datetime.

Create a variable VarLogFolderPath and save the path of folder where you want to save the log files.

Step 7:
Create expression for our Log File Name for each execution. Go to MyLogFile Connection Manager and Right Click on it. Go to properties and then expression and write expressions as shown

Expression :
@[User::VarLogFolderPath]+"\\"+ @[System::PackageName]+"_"+Replace(Replace(Replace(SUBSTRING((DT_WSTR,50)(GETDATE()),1,16),"-","")," ","_"),":","")+".log"

Note : 
As you have noticed that I did not save the time till seconds level. If I will do that , SSIS will create multiple log files , couple of them while validation. To avoid that I am creating log file with YYYYMMDD_HHMM.

Final Output : 
Let's run our SSIS Package couple of times and check the Log File Folder.Wow!! the log files are created for each execution of SSIS Package.


  1. I feel SSIS is the best and most useful component of SSIS package anyways.This is always very useful to provide an edge and explore more about solutions to many complex IT problems.

    SSIS Postgresql Read

  2. Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. power harrow

  3. I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks... taxi vlaardingen

  4. Nice to be visiting your blog once more, it has been months for me. Well this article that ive been waited for therefore long. i want this article to finish my assignment within the faculty, and it has same topic together with your article. Thanks, nice share. 토토사이트

  5. Merely a smiling visitant here to share the love (:, btw outstanding style. click here

  6. Nice to see your blog. It feels good to get good information. Please visit my blog as well. It will help.

  7. I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. 토토사이트

  8. Your articles are inventive. I am looking forward to reading the plethora of articles that you have linked here. Thumbs up! 릴게임