15

I don't know if this will help, but i enabled logging to a text file called test.txt on my C Drive.

Public Sub Main()
    Dim rowsProcessed As Integer = 100
    Dim emptyBytes(0) As Byte

    Dts.Log("Testing, Test 1,2,3", rowsProcessed.ToString, emptyBytes)

    Dts.TaskResult = ScriptResults.Success
End Sub
codeulike
  • 22,514
  • 29
  • 120
  • 167
sadd
  • 151
  • 1
  • 1
  • 4

4 Answers4

28

You have to go into the SSIS->Logging menu and tick checkboxes like a crazy checkbox-ticking-ninja to get this to work.

There are various checkboxes that have to be checked, and some of them only appear when you click on the script tasks, so it took me a while to figure this out:

  • First, enable your logging provider (that you have set up, right?) by ticking it on the Providers and Logs tab.
  • Then switch to the Details tab (which shows various events that you might want to log)
  • For the DTS.Log() method you need the ScriptTaskLogEntry event, but they only show up when you click on Script Tasks in the tree on the left.
  • So, click each of your Script Tasks in the tree on the left, enable it for logging, and then tick the Script Tasks event on the details tab.
  • Also make sure your logging provider is ticked for each script task

See also: http://msdn.microsoft.com/en-us/library/ms136131.aspx

codeulike
  • 22,514
  • 29
  • 120
  • 167
  • As far as I understand (and tested), in this window, half-check means that it will inherit its parent settings. so no ninja-skills is required. simply check the parent as in this [image](http://imgur.com/IRh4Xjq) :-) – itsho Apr 08 '14 at 15:00
  • @itsho I think he meant that if you have a script task / script component it has some events that the higher level task / component doesn't have. Thats why the child element inherits only the events that are common for both the parent and the child. I'd like to add a link to my question here in StackOverflow which is somehow relevant to this and still has no answer http://stackoverflow.com/questions/22829255/why-ssis-logging-is-not-working-in-a-script-component-script-task-when-inside – kivikall Apr 09 '14 at 06:36
  • 1
    LOL, crazy checkbox-ticking-ninja but so true – HLGEM Oct 31 '14 at 14:54
  • Checkbox-ticking-ninja deserves an upvote all by itself – David W Jul 02 '15 at 15:53
  • also, you must tick the log provider one more time for the script task itself. Just click the one at the package/parent level is not enough – soMuchToLearnAndShare Aug 22 '18 at 13:13
12

This is an old question and @codeulike has answered it well but I would like to add a note about the logging behavior in debug mode, specially for someone new to SSIS or SSIS logging (like me) - Assuming you have all the configuration in place required for logging, if execute a selected task that you expect to log, it still will not log. Only if you execute (or debug) the entire package, then the logging will work.

HappyTown
  • 6,036
  • 8
  • 38
  • 51
  • THANK YOU!!! Banging my head for an hour trying to get any logging to come out. This for a task I was testing and executing directly. Silly me, why should that work. :( Thanks for saving me from more wasted time! – Kevin Finck Feb 26 '18 at 16:55
  • @KevinFinck Glad to hear it helped. Upvote if you find any questions and answers useful. In Stackoverflow community, *Upvote* is *Thank you* :) – HappyTown Feb 26 '18 at 18:26
0

If you are sure you have done configured everything correctly and still cant see your dbo.sysssislog in the database you selected, then check in the following YourDatabase > tables > system tables

you can find your loggings there.

its my first time doing package loggings and configured everything correctly and could not see that dbo.sysssislog in the database it was supposed to do loggings and banging my head for half an hour when i realised it was in system tables of that particular database.

0

I realize that this question is rather old, but maybe it helps someone.

I ran into the same problem - while debugging in Visual Studio my textfile logging provider just did not write into the configured logfile.

My logfile was in the directory "project-directory/bin/development".

After changing the path to "project-directory-name"-root (eg. "/project-directory-name/test.txt" it worked.

I cannot explain this - it is just what I have observed.

Erik Mandke
  • 1,577
  • 3
  • 23
  • 30