Adding custom log provider programmatically
Hi All, I created a custom log provider and it works fine. However I now want to add it programmatically to all the packages I have. If I were to do this with the regular SQL logger it would look like this: LogProvider provider = pkg.LogProviders.Add("DTS.LogProviderSQLServer.2"); My question is what name should I be using, is it the name of the assembly as it appears in the GAC?
June 10th, 2011 3:18pm

Do you mean you already have packages designed in BIDS (not programmatically) and now you want to add/inject your custom logging into each? Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2011 4:14pm

Well actually they are a series of DTS packages that have been upgraded, but yes they work in BIDS, so does the log provider, and yes now I'm trying to add it to all the packages programatically. I based it off the HTMLLogProviderCS sample. I'm assuming that the name is contained here:[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming","CA1724:TypeNamesShouldNotMatchNamespaces"),System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design","CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable"), DtsLogProvider(DisplayName = "Custom log provider for MSMQ (CS)", Description = "Writes log entries for events to MSMQ", LogProviderType = "Custom")]I tried the name of the assembly, I tried most of the above, but it always says not recognized as a valid Log Provider but yet it works in BIDS on the same machine, it's in the GAC, it runs fine. Just not sure how to refer to it.
June 10th, 2011 4:26pm

I added a ProgID, but still getting the same error: using System.Runtime.InteropServices; [ProgId("MSMQLogProviderCS.Class1")] The log provider type "MSMQLogProviderCS.Class1" specified for log provider "{CB4160A6-E494-41E2-A3F2-463F94F3514E}" is not recognized as a valid log provider type. This error occurs when an attempt is made to create a log provider for unknown log provider type. Verify the spelling in the log provider type name.
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2011 4:39pm

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

Other recent topics Other recent topics