Discussion:
Dynamic Log File
(too old to reply)
Mythran
2010-04-09 23:06:34 UTC
Permalink
This may be a question asked all the time, but I have checked on Google and
quite a few other places and can't seem to find a good answer.

I have an SSIS package that logs to a dynamically named file (based on the
start date of the package). I noticed that the log file name is whatever
the log connection's ConnectionString property is set to...then it creates
another log file with the name I gave it originally...

I know I can specify the log file by determining the log file's name first,
then set it in the configuration file, environment variable, or registry
prior to running the package and it would only create a single log file with
that name. Is there any way to create the log file with the formatted start
date as the log file's name from within the package without doing anything
external?

Thanks,
Mythran
Todd C
2010-04-12 11:31:01 UTC
Permalink
I do this all the time. Create a new Flat file Connectin Manager and specify
'create file' for it. Give it an original path such as C:\MyFile.txt. Let's
assign a name to it as "My Log FIle" in the Connection Manager tray.
Now click on that CM, and find the Expressions property in the Properties
pane. Make a new Expression for the Connection String property. My expression
typically incorporates all of the following elements:
*A Package level variable called "Logging_Folder"
*The package name
*The Machine name
*A date stamp in the format of YYYYMMDD
*A literal file extension of ".txt"

Using Configuraions, the Logging_Folder varialbe changes depending on the
environment.

All the above is defined in a Template package so when i create a new
package off of that, I don't need to do anything about re-designing the log
file name. It comes out as desired.

HTH.
--
Todd C
MCTS SQL Server 2005
Post by Mythran
This may be a question asked all the time, but I have checked on Google and
quite a few other places and can't seem to find a good answer.
I have an SSIS package that logs to a dynamically named file (based on the
start date of the package). I noticed that the log file name is whatever
the log connection's ConnectionString property is set to...then it creates
another log file with the name I gave it originally...
I know I can specify the log file by determining the log file's name first,
then set it in the configuration file, environment variable, or registry
prior to running the package and it would only create a single log file with
that name. Is there any way to create the log file with the formatted start
date as the log file's name from within the package without doing anything
external?
Thanks,
Mythran
Mythran
2010-04-12 16:04:10 UTC
Permalink
Post by Todd C
I do this all the time. Create a new Flat file Connectin Manager and specify
'create file' for it. Give it an original path such as C:\MyFile.txt. Let's
assign a name to it as "My Log FIle" in the Connection Manager tray.
Now click on that CM, and find the Expressions property in the Properties
pane. Make a new Expression for the Connection String property. My expression
*A Package level variable called "Logging_Folder"
*The package name
*The Machine name
*A date stamp in the format of YYYYMMDD
*A literal file extension of ".txt"
Using Configuraions, the Logging_Folder varialbe changes depending on the
environment.
All the above is defined in a Template package so when i create a new
package off of that, I don't need to do anything about re-designing the log
file name. It comes out as desired.
HTH.
--
Todd C
MCTS SQL Server 2005
Post by Mythran
This may be a question asked all the time, but I have checked on Google and
quite a few other places and can't seem to find a good answer.
I have an SSIS package that logs to a dynamically named file (based on the
start date of the package). I noticed that the log file name is whatever
the log connection's ConnectionString property is set to...then it creates
another log file with the name I gave it originally...
I know I can specify the log file by determining the log file's name first,
then set it in the configuration file, environment variable, or registry
prior to running the package and it would only create a single log file with
that name. Is there any way to create the log file with the formatted start
date as the log file's name from within the package without doing anything
external?
Thanks,
Mythran
Thanks for your reply...but when I do what you stated, I still get two log
files...try yourself. The original log file name you entered:
"C:\MyFile.txt" is probably getting created too! :(

Thanks,
Mythran
unknown
2010-04-28 16:23:06 UTC
Permalink
Hi,

I am also getting 2 error log files created..
can you tell me how to make it 1?

Thanks,
Rubitha



Mythran wrote:

Thanks for your reply...
12-Apr-10

Thanks for your reply...but when I do what you stated, I still get two log
files...try yourself. The original log file name you entered:
"C:\MyFile.txt" is probably getting created too! :(

Thanks,
Mythran

Previous Posts In This Thread:

On Friday, April 09, 2010 7:06 PM
Mythran wrote:

Dynamic Log File
This may be a question asked all the time, but I have checked on Google and
quite a few other places and cannot seem to find a good answer.

I have an SSIS package that logs to a dynamically named file (based on the
start date of the package). I noticed that the log file name is whatever
the log connection's ConnectionString property is set to...then it creates
another log file with the name I gave it originally...

I know I can specify the log file by determining the log file's name first,
then set it in the configuration file, environment variable, or registry
prior to running the package and it would only create a single log file with
that name. Is there any way to create the log file with the formatted start
date as the log file's name from within the package without doing anything
external?

Thanks,
Mythran

On Monday, April 12, 2010 7:31 AM
Todd C wrote:

I do this all the time.
I do this all the time. Create a new Flat file Connectin Manager and specify
'create file' for it. Give it an original path such as C:\MyFile.txt. Let's
assign a name to it as "My Log FIle" in the Connection Manager tray.
Now click on that CM, and find the Expressions property in the Properties
pane. Make a new Expression for the Connection String property. My expression
typically incorporates all of the following elements:
*A Package level variable called "Logging_Folder"
*The package name
*The Machine name
*A date stamp in the format of YYYYMMDD
*A literal file extension of ".txt"

Using Configuraions, the Logging_Folder varialbe changes depending on the
environment.

All the above is defined in a Template package so when i create a new
package off of that, I do not need to do anything about re-designing the log
file name. It comes out as desired.

HTH.
--
Todd C
MCTS SQL Server 2005


"Mythran" wrote:

On Monday, April 12, 2010 12:04 PM
Mythran wrote:

Thanks for your reply...
Thanks for your reply...but when I do what you stated, I still get two log
files...try yourself. The original log file name you entered:
"C:\MyFile.txt" is probably getting created too! :(

Thanks,
Mythran


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Binding Beyond the Limitation of Name Scopes
http://www.eggheadcafe.com/tutorials/aspnet/ef583104-e507-491d-b05f-49faac8854c8/wpf-binding-beyond-the-li.aspx
Mythran
2010-04-29 23:05:38 UTC
Permalink
Post by unknown
Hi,
I am also getting 2 error log files created..
can you tell me how to make it 1?
Thanks,
Rubitha
Thanks for your reply...
12-Apr-10
Thanks for your reply...but when I do what you stated, I still get two log
"C:\MyFile.txt" is probably getting created too! :(
Thanks,
Mythran
On Friday, April 09, 2010 7:06 PM
Dynamic Log File
This may be a question asked all the time, but I have checked on Google and
quite a few other places and cannot seem to find a good answer.
I have an SSIS package that logs to a dynamically named file (based on the
start date of the package). I noticed that the log file name is whatever
the log connection's ConnectionString property is set to...then it creates
another log file with the name I gave it originally...
I know I can specify the log file by determining the log file's name first,
then set it in the configuration file, environment variable, or registry
prior to running the package and it would only create a single log file with
that name. Is there any way to create the log file with the formatted start
date as the log file's name from within the package without doing anything
external?
Thanks,
Mythran
On Monday, April 12, 2010 7:31 AM
I do this all the time.
I do this all the time. Create a new Flat file Connectin Manager and specify
'create file' for it. Give it an original path such as C:\MyFile.txt. Let's
assign a name to it as "My Log FIle" in the Connection Manager tray.
Now click on that CM, and find the Expressions property in the Properties
pane. Make a new Expression for the Connection String property. My expression
*A Package level variable called "Logging_Folder"
*The package name
*The Machine name
*A date stamp in the format of YYYYMMDD
*A literal file extension of ".txt"
Using Configuraions, the Logging_Folder varialbe changes depending on the
environment.
All the above is defined in a Template package so when i create a new
package off of that, I do not need to do anything about re-designing the log
file name. It comes out as desired.
HTH.
--
Todd C
MCTS SQL Server 2005
On Monday, April 12, 2010 12:04 PM
Thanks for your reply...
Thanks for your reply...but when I do what you stated, I still get two log
"C:\MyFile.txt" is probably getting created too! :(
Thanks,
Mythran
Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Binding Beyond the Limitation of Name Scopes
http://www.eggheadcafe.com/tutorials/aspnet/ef583104-e507-491d-b05f-49faac8854c8/wpf-binding-beyond-the-li.aspx
I still have no answer to this :(

Mythran

Loading...