Ever heard of custom log providers? They are a mechanism within SSIS by which we can write our own log providers in .Net rather than us those that are provided out of the box. Just recently I had cause to look into building a custom log provider as I was investigating whether it was feasible to replace my technique for custom logging using event handlers with such a custom log provider. Unfortunately I came across a rather large limitation of custom log providers, let me explain.
In order to build a custom log provider you need to inherit from LogProviderBase class and one of the most important methods in there that has to be overridden is LogProviderBase.InitializeLogProvider because that's the method that gets called when the log provider is added to the package. Let's take a look at the signature of that method:
- virtual void InitializeLogProvider ( Connections connections, IDTSInfoEvents events, ObjectReferenceTracker refTracker )
You'll notice that this method provides the log provider with access to the package's connections and events but it does NOT provide access to the package's variables which means that custom log providers cannot log information that you may have stored in variables. Hence, I cannot build a log provider to replace my current method of using event handlers because with those I make heavy heavy use of variables. I can kind of understand it because log providers don't really understand scope but nevertheless I am of the opinion that this is a big limitation.
This doesn't mean custom log providers are useless of course but be aware of this if you are starting down the road of building custom log providers.
If you want to change this behaviour then vote for the change here: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=302168
-Jamie