Script task: Dts.Logging.Log
I am trying to understand the use-case ofDts.Logging.Log. Following BOL, I see that I can use Dts.Log to send a custom log message to my log provider. The following example code produces an eventcalled "User:ScriptTaskLogEntry", with the message "My custom message here". Dim dataBytes(0) As Byte Dts.Log("My custom message here", 0, dataBytes) I would like to be able to produce my own custom event (lets call it "MyCustomEvent"), as well as a custom log message.I thought it would be possible via Dts.Logging.Log, which requires that I specify an event name, in addition to a log entry. However, when I place the following code in the script task, I do not get any logging whatsoever. Dim dataBytes(0) As Byte Dts.Logging.Log("MyCustomEvent", System.Environment.MachineName, System.Environment.UserName, "Custom Log", "", "", "My custom message here", Now, Now, 0, dataBytes) Any thoughts? Thanks!
July 6th, 2006 6:37pm

The script task can't log custom message type. The problem is that custom log message needs to be declared by task in advance so that it appears in the Details tab of the Logging window.Custom task (reusable separately packaged.NET or C++ code, that appears on toolbox just like any Microsoft task) can do it, but this functionality is not available in Script task.
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2006 9:20pm

This is kind of a late response but it may come in handy for people with the same problem; on your Script Task try this: Code Block Dts.Events.FireInformation(0, "DavidKreps", "This is a custom log entry thrown by a script task)
October 24th, 2007 1:10pm

Very late reply. But, it will be useful for others. Create custom log in Script task. http://www.roelvanlisdonk.nl/?p=1855Thanks Ayyappan Thangaraj, http://SQLServerRider.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
January 27th, 2012 1:34pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics