Re: Logging components?



> But I'm still trying to figure out what the logging problem is in the
first
> place.

There is no problem! <g>

This is all stuff that can be done easily anyway, with
MyLogToServerProcedure(var1, Var2, Var3 . . .);

I was just looking to see if there was anything out there that would wrap it
neatly in a component framework, provide a little bit of extra flexibility
with regard to storage formats etc. And a bit more intelligence with regard
to logging frequently occuring exceptions once for each type.

> What information is being logged?

To give a hypothetical example, in the form create in a C/S project, you try
and connect to the database. The database is not available, so it gives you
a 'cant find database' exception. You anticipated this possibility, so you
have it in a try/except block. But a user complains that they can't start
the program. You get them to send the log, you see the log item, and you
figure the user isn't starting hte program because either the database can't
be found ont he network or it wasn't started.

Another example, you have a case statement or series of if statements that
are meant to be exhaustive. But just in case, in the final 'else' you log an
error saying that it went somewhere it was not meant to. (In this example
perhaps it might be better though to make it an exception and not handle it,
so MadExcept/EurekaLog tells you the problem is occuring).

etc, I don't seem to be able to think of good examples of the to of my head
right now.

> Why can you not just do the special processing in your exception handlers
> and then re-raise the exceptions and let execution flow to MadExcept or
> Eurekalog to log that the exception occurred (without showing error
message
> box to users)?

I could. I'd also have to raise some from scratch, as it is not only errors
arising from exceptions I am dealing with.

I will think some more about this solution, it does have some merits.

The part it doesn't offer of course is the flexibility for logging it to
other formats eg XML, databases. Maybe this is a good support question for
MadExcept and EurekaLog.

Lauchlan Mackinnon


.



Relevant Pages

  • Re: Enterprise Library and PostgreSQL (Npgsql)
    ... I found the database provider code at ... Catch ex As Exception ... If the connection string is invalid or the database server is ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework)
  • Re: Using form controls from other classes.
    ... button on Form when C catches the exception. ... handler because I add the handler after creating the objects. ... If an exception is thrown and caught during initialization (whether part of construction or separate), and the fact of that exception is important to the clients of class C, why is that fact not exposed via a property? ... My Form contains the handlers for all events including logging. ...
    (microsoft.public.dotnet.languages.csharp)
  • Object reference not set to an instance of an object.
    ... Object reference not set to an instance of an object. ... An unhandled exception occurred during the execution of the ... Dim myJobRequest As New skillsDB.jobRequest ... Session= "The skills database has been updated ...
    (microsoft.public.dotnet.general)
  • Object reference not set to an instance of an object.
    ... ASP.NET that uses web service for SQL Server 2000 DB access. ... Exception Details: System.NullReferenceException: Object reference not ... Dim myJobRequest As New skillsDB.jobRequest ... Session= "The skills database has been updated ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: SqlCeConnection
    ... data from the database using either a DataReader, DataSet, and binding the ... error but the Exception object does not contain a message to display. ... private void CloseConnection() ... SqlCeCommand sqlCommand = null; ...
    (microsoft.public.sqlserver.ce)