Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9215725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:16:02+00:00 2026-06-18T02:16:02+00:00

I have enabled file logging in an SSIS package and for the log file

  • 0

I have enabled file logging in an SSIS package and for the log file connection string I am using the expression below to generate a log file in the format housekeepinglog2013_01_31_12_07.xml

@[User::VAR_LOG_PATH] +"\\housekeepinglog" + 
(DATEDIFF( "dd", @[System::StartTime], GETDATE() ) < 1 ?
(DT_STR,4,1252)DATEPART( "yyyy" , @[System::StartTime]) +  "_" +
RIGHT("0" + (DT_STR,4,1252)DATEPART("mm", @[System::StartTime]), 2) + "_" +
RIGHT("0" + (DT_STR,4,1252)DATEPART("dd", @[System::StartTime]), 2) +  "_" +
RIGHT("0" + (DT_STR,4,1252)DATEPART("hh", @[System::StartTime]), 2) +  "_" +
RIGHT("0" + (DT_STR,4,1252)DATEPART("mi", @[System::StartTime]), 2) +  "_" +
RIGHT("0" + (DT_STR,4,1252)DATEPART("ss", @[System::StartTime]), 2)
: "") 
+ ".xml"

The issue is that instead of creating one log file I get two. One is complete with the correct date and another that contains just the log information on package validation but with a date that is about a day old.
It seems that the StartTime System variable gets set once the package has started but this is done after validation and the validation is creating log entries. Before this the StartDate variable holds some arbitrary date that was created when editing the package.

It is only a minor irritation but I was wondering if anyone knew a non clunky way to supress the second log file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:16:04+00:00Added an answer on June 18, 2026 at 2:16 am

    I’m guessing the “older” looking log also has the PackageStart event too, yeah? What you are seeing here is somewhat related to the endeavor many try and that’s to dynamically enable/disable logging on packages without modifying them. The challenge they run into is that the base dtexec.exe gets the package validated and all the that before you’d ever get into a place where your expressions begin to get validated.

    The two options that come to mind are to provide the value for your connection string from the command line. Something like dtexec /file .\mypackage.dtsx /set \Package.Connections[XmlLogCM].Properties[ConnectionString];\"c:\housekeepinglog_SomeDosSyntaxForDateTime.xml\"

    The second is to start the packages differently. Either through your custom .NET code using Microsoft.SqlServer.Dts.Runtime or download and use DTLoggedExec

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have jboss logging enabled in our application. Currently we are using the 'Rotating-file-handler'
I have enabled site-wide Django caching , but the third-party apps I am using
I have enabled google Minify in code igniter using this library on our website.
I'm using the org.jboss.logging.Logger class, and seem to have come across an incongruity. When
I have an SSIS Package, call it PackageA . Sometimes, I want to have
I am trying to use file_get_contents.I have made sure that allow_url_fopen is enabled in
I have enabled search in my MonoTouch.Dialog. After each keystroke I call the database,
I have enabled the Web Server on my Mac OS X (10.5.6) by going
I have enabled the lighttpd mod_webdav module and set up a webdav mount point
I have enabled USB debugging on my phone and have set the Debuggable permission

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.