I am testing a set of SSIS packages, In order to test my SSIS packages for errors I have two negative test cases
1) I didn't provide checkpoint file for the checkpoint enabled package.
2) I provide a wrong configuration file
Even though I am using a script task in my "on error" event of my SSIS package. It is not executed. (Perhaps because the package doesn't even execute).
My problem is that SSIS itself puts just a simple one liner in windows event log "Package Failure Error". It does not provide which package failed, why it failed etc. Therefore the admin who gets the ticket to resolve the issue has no clue of what is going wrong and where!
Since my custom logger doesn't even run, I don't know how can I put more details into the windows event log.
How can I resolve this?
regards,
Abhishek.
Sorry to bump so soon, but I am really stuck here.
|||Loggers don't even enter the picture on malformed configuration file warnings/errors. Malformed configurations files are detected at package load time, even before validation. So, if you have a logger ( custom or stock, doesn't matter) defined inside the package, warnings like "invalid xml configuration file" won't be sent there.The sequence for possible package execution is as follows:
1. Package Load (warnings/errors such as invalid configuration file happen here )
2. Package Validation
3. Package Execution (with validation too)
To trap package load errors, you could capture dtexec's console log output (if you're using that mechanism for package execution).
To implement your own logging; that is, to catch warnings/errors early in the package lifespan without using dtexec's console logger to do so, implement IDTSEvents (by subclassing DefaultsEvents) on package load. See Loading and Running a Local package programmatically (the capturing events from a running package section)
For example, the following will log package load,validate,and execute events, while loggers will get validate and execute events.
Code Snippet
using System;using System.Diagnostics;
using Microsoft.SqlServer.Dts.Runtime;
namespace IS
{
class PackageRunner
{
static void Main(string[] args)
{
string pkgFileName = args[0];
ISEventsListener eventListener = new ISEventsListener();
// subclass of DefaultEvents
Application isApp = new Application();
// listen for pre-validation errors via LoadPackage
using (Package pkg = isApp.LoadPackage(pkgFileName, eventListener))
{
DTSExecResult validationOutcome = pkg.Validate(null, null, eventListener, null);
if (validationOutcome == DTSExecResult.Success)
{
DTSExecResult executionOutcome = pkg.Execute(null, null, eventListener, null, null);
}
}
Console.WriteLine("Press something...");
Console.ReadKey();
}
}
}
Checkpoint files are a different story, a missing checkpoint file setting will be logged by custom loggers and the package will not execute because of that.
No comments:
Post a Comment