- Text File Logging
- SQL Server Profiler
- SQL Server
- Windows Event Log
- XML File
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
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.
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
@[User::VarLogFolderPath]+”\\”+ @[System::PackageName]+”_”+Replace(Replace(Replace(SUBSTRING((DT_WSTR,50)(GETDATE()),1,16),”-“,””),” “,”_”),”:”,””)+”.log”