473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Exception and logging component

I'm using a .Net application to execute DTS packages within Sqlserver,I need
to have very customizable and powerful Exception maangement systems which
loggs different issues happend in the DTS package with my own errorCode. Can
somebody give me some ideas?

Thanks
Nov 16 '05 #1
6 1984
What kind of ideas do you want? The first thing is to understand the basics
of .NET Exceptions (try, catch, finally, throw, etc.) and to become familiar
with the existing .NET Exceptions of the Framework
(ArgumentOutOfRangeException, etc.) to reuse them or to know if you need to
create custom ones. Then, to define your strategy to deal with exceptions
and to decide how to report them (on screen, by e-mail, in the event log,
etc.).

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Ali-R" <Al**@microsft.com> escribió en el mensaje
news:um**************@TK2MSFTNGP15.phx.gbl...
I'm using a .Net application to execute DTS packages within Sqlserver,I
need to have very customizable and powerful Exception maangement systems
which loggs different issues happend in the DTS package with my own
errorCode. Can somebody give me some ideas?

Thanks

Nov 16 '05 #2
Here is what I have to deal with:

I'm getting a CSV file from our clients which I need to validate it before
sending it to a DTS packages so there are two types of exceptions that might
happen:

1) Exceptions which should be thrown while parsing the CSV file
2) Exceptions which are thrown in the DTS package

Do you think I can handle both types of exceptions by implementing my own
Exception handler or by using Microsoft Exception management block?

Thanks for yuor help.


"Carlos J. Quintero [.NET MVP]" <ca*****@NOSPAMsogecable.com> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
What kind of ideas do you want? The first thing is to understand the
basics of .NET Exceptions (try, catch, finally, throw, etc.) and to become
familiar with the existing .NET Exceptions of the Framework
(ArgumentOutOfRangeException, etc.) to reuse them or to know if you need
to create custom ones. Then, to define your strategy to deal with
exceptions and to decide how to report them (on screen, by e-mail, in the
event log, etc.).

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Ali-R" <Al**@microsft.com> escribió en el mensaje
news:um**************@TK2MSFTNGP15.phx.gbl...
I'm using a .Net application to execute DTS packages within Sqlserver,I
need to have very customizable and powerful Exception maangement systems
which loggs different issues happend in the DTS package with my own
errorCode. Can somebody give me some ideas?

Thanks


Nov 16 '05 #3
Yes, it seems simple and some exception handlers will be enough. Some things
to consider:

- Add handlers for unhandled exceptions (which can be from Main thread,
manual threads, pool threads, finalizer thread, etc.).
- Notice that different exceptions need different treatment. For example,
OutOfMemoryException requires special care.
- Provide as much info as possible when reporting an exception; for example,
the line which caused an exception parsing the CSV file.
- Some times an exception wrappes an inner exception which contains the
actual cause of the exception. So, when reporting, try to use
Exception.GetBaseException() rather than the wrapper.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Ali-R" <Al**@microsft.com> escribió en el mensaje
news:eX*************@TK2MSFTNGP15.phx.gbl...
Here is what I have to deal with:

I'm getting a CSV file from our clients which I need to validate it before
sending it to a DTS packages so there are two types of exceptions that
might happen:

1) Exceptions which should be thrown while parsing the CSV file
2) Exceptions which are thrown in the DTS package

Do you think I can handle both types of exceptions by implementing my own
Exception handler or by using Microsoft Exception management block?

Thanks for yuor help.


Nov 16 '05 #4
Excellent notifications,Thanks very much

I'd like to log both types of Exceptions in the same place(in the same file
for instance)
1) Exceptions which should be thrown while parsing the CSV file
2) Exceptions which are thrown in the DTS package

What's your recommandation for that?

Thanks

"Carlos J. Quintero [.NET MVP]" <ca*****@NOSPAMsogecable.com> wrote in
message news:%2******************@tk2msftngp13.phx.gbl... Yes, it seems simple and some exception handlers will be enough. Some
things to consider:

- Add handlers for unhandled exceptions (which can be from Main thread,
manual threads, pool threads, finalizer thread, etc.).
- Notice that different exceptions need different treatment. For example,
OutOfMemoryException requires special care.
- Provide as much info as possible when reporting an exception; for
example, the line which caused an exception parsing the CSV file.
- Some times an exception wrappes an inner exception which contains the
actual cause of the exception. So, when reporting, try to use
Exception.GetBaseException() rather than the wrapper.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Ali-R" <Al**@microsft.com> escribió en el mensaje
news:eX*************@TK2MSFTNGP15.phx.gbl...
Here is what I have to deal with:

I'm getting a CSV file from our clients which I need to validate it
before sending it to a DTS packages so there are two types of exceptions
that might happen:

1) Exceptions which should be thrown while parsing the CSV file
2) Exceptions which are thrown in the DTS package

Do you think I can handle both types of exceptions by implementing my own
Exception handler or by using Microsoft Exception management block?

Thanks for yuor help.

Nov 16 '05 #5
Once you have decided how to log exceptions, you have to code a centralized
routine to be called from wherever an exception is catched. Needless to say
that this routine must be rock-solid...in my last project, this routine
received 2 parameters to indicate how to log it: to the event log, by-email,
or both. If you have requested a way, and it fails (what should not happen,
of course), you can still use the other way to notify that the exception
notifier routine has failed, to avoid an exception being silenced.

Then, you have to code your application and do a lot of testing since you
don´t know what exceptions can occur (I think that Java methods inform the
developer what exceptions can throw, but not in .NET). When parsing, you can
expect the IndexOutOfRangeException when strings are shorter than expected,
but only testing can provide you all exceptions that can happen.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Ali-R" <Al**@microsft.com> escribió en el mensaje
news:OD*************@TK2MSFTNGP10.phx.gbl...
Excellent notifications,Thanks very much

I'd like to log both types of Exceptions in the same place(in the same
file for instance)
1) Exceptions which should be thrown while parsing the CSV file
2) Exceptions which are thrown in the DTS package


What's your recommandation for that?

Thanks


Nov 16 '05 #6
Thanks for your suggessions.
"Carlos J. Quintero [.NET MVP]" <ca*****@NOSPAMsogecable.com> wrote in
message news:%2***************@TK2MSFTNGP14.phx.gbl...
Once you have decided how to log exceptions, you have to code a
centralized routine to be called from wherever an exception is catched.
Needless to say that this routine must be rock-solid...in my last project,
this routine received 2 parameters to indicate how to log it: to the event
log, by-email, or both. If you have requested a way, and it fails (what
should not happen, of course), you can still use the other way to notify
that the exception notifier routine has failed, to avoid an exception
being silenced.

Then, you have to code your application and do a lot of testing since you
don´t know what exceptions can occur (I think that Java methods inform the
developer what exceptions can throw, but not in .NET). When parsing, you
can expect the IndexOutOfRangeException when strings are shorter than
expected, but only testing can provide you all exceptions that can happen.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Ali-R" <Al**@microsft.com> escribió en el mensaje
news:OD*************@TK2MSFTNGP10.phx.gbl...
Excellent notifications,Thanks very much

I'd like to log both types of Exceptions in the same place(in the same
file for instance)
1) Exceptions which should be thrown while parsing the CSV file
2) Exceptions which are thrown in the DTS package


What's your recommandation for that?

Thanks

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: j vickroy | last post by:
Hello, I'm trying to understand the behavior of the Python 2.3 logging module (MS Windows 2k) with regard to RotatingFileHandler. The following script illustrates a puzzling problem. What is...
6
by: Kevin Jackson | last post by:
Let's say we log exceptions to the windows application event log using the Exception Management Application Block. Is there a pattern that can be used so the exception is logged only once and not...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
11
by: Matt | last post by:
I have written a console application that runs as a batch job on Windows 2000 Server. Every once in a while I am getting an exception thrown to the console. Is there a way I can create a global...
2
by: Chumma Dede | last post by:
Hi, I need to code a DLL in .NET which logs the response times for our asp.net multi-tier application. The problem is we need to log the timestamps at multiple stages in a process lifecycle...
4
by: Ray Cassick \(Home\) | last post by:
I am trying to create a generic logging component that will accept an exception object and create a string containing all the properties and their values available for a specific exception. My...
0
by: rajesh.hanchate | last post by:
Please help me in resolving this issue. I am using EnterpriseLibrary 2.0 Exception and logging block for logging exceptions to event log. It works fine for sometime. After some time it stops...
3
by: guybenron | last post by:
Hey, I have a sort of petty-neurotic question, I'm kinda pedantic and like to keep my log directories clean, and this thing is bothering me to the point of actually posting a question (couldn't...
17
by: Cramer | last post by:
I plan to implement an exception logging feature in an ASP.NET Web application that writes encountered exceptions to disk. The exception data will be stored as XML. I am planning on having each...
3
by: Robert Rawlins | last post by:
Hi Mk, Yeah it's got me a little bemused to be honest, I've tried playing around with configuration options this morning and not been able to achieve anything that works properly. I'll keep...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.