But I only wanted one log file!
Suppose you are using a Log File into which you do your logging. Setting it up is straightforward, and you want it to go to "C:\SSIS\Logs\PackageName.log" during testing.
Later on you decide to go for a more sophisticated version and use a configuration file to determine where the log will be placed. This makes sense, as your deployment server might not have the "C:\SSIS\Logs\PackageName.log" directory, and perhaps you set up the configuration file to have the log's connection string set as "D:\SSIS\Logs\PackageName.log".
When you run the package, where will your log file be found?
You'd assume that it'll be "D:\SSIS\Logs" because the real log file location will be read from the configuration file - yes?
Actually what happens is that you'll have 2 log files - one on "C:\SSIS\Logs" and one on "D:\SSIS\Logs"! The first will be quite small, while the second contains most of the info.
At first I was surprised to see this after a colleague (Reno Messina) pointed it out. Then I decided it made sense. The first log file ("C:\SSIS\Logs") has to be there to log the process up to the loading of the configurations. Otherwise if the log location in the configuration file itself was incorrect we'd have no way of getting any info at all and be even more confused
So, if you know the location of your log file on the destination server, set this up in the package as well as the configuration file. That way your log info will all be combined together. If not, then make sure it's a location that exists on all your servers, just to be sure that the initial log info will go somewhere without breaking the package.
Later on you decide to go for a more sophisticated version and use a configuration file to determine where the log will be placed. This makes sense, as your deployment server might not have the "C:\SSIS\Logs\PackageName.log" directory, and perhaps you set up the configuration file to have the log's connection string set as "D:\SSIS\Logs\PackageName.log".
When you run the package, where will your log file be found?
You'd assume that it'll be "D:\SSIS\Logs" because the real log file location will be read from the configuration file - yes?
Actually what happens is that you'll have 2 log files - one on "C:\SSIS\Logs" and one on "D:\SSIS\Logs"! The first will be quite small, while the second contains most of the info.
At first I was surprised to see this after a colleague (Reno Messina) pointed it out. Then I decided it made sense. The first log file ("C:\SSIS\Logs") has to be there to log the process up to the loading of the configurations. Otherwise if the log location in the configuration file itself was incorrect we'd have no way of getting any info at all and be even more confused
So, if you know the location of your log file on the destination server, set this up in the package as well as the configuration file. That way your log info will all be combined together. If not, then make sure it's a location that exists on all your servers, just to be sure that the initial log info will go somewhere without breaking the package.

Comments