Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2004

Tip: Looking for answers? Try searching our database.

Logging Exceptions ... Where ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gurminder - 30 Aug 2004 08:11 GMT
Hi,
Can anybody guide which approach is the best for logging exceptions ?
The solution should consider performance, concurrency issues, production
scenarious, easy of data analysis & purging operations.

Logging Exceptions to,
1. Text Files
2. SQL Server
3. MSMQ
or, suggest any other ...

Regds
Gurminder
Raghavendra  T V - 30 Aug 2004 08:33 GMT
Hi Gurminder,

I would suggest you to log errors in the System EventLog.
Logging errors to event log is faster than logging errors to a text file.
But if you application is yet to be deployed to production server.
I would suggest you to go for logging errors to text file and once you are
done with fixing
regularly occuring errors you will be limiting the errors that will be
logged to the text file.
then you can move the error logging to the System Event log.

Final conclusion: System Event logging is the best recommended if you
consider Performance, concurrency issues, production
scenarious, easy of data analysis & purging operations.

and also you have various 3rd party , some free tools for analysing the
system Event logs.

[For you knowledge:  you can read the Microsoft - Improving .NET Application
Performance and Scalability.pdf ebook published by microsoft which
is available for free download . This book clearly mentions how to log
errors and where and which is the best one to go for.]

you can download the book from here.
http://www.microsoft.com/downloads/details.aspx?FamilyId=8A2E454D-F30E-4E72-B531
-75384A0F1C47&displaylang=en


Thanks
Raghavendra

> Hi,
>  Can anybody guide which approach is the best for logging exceptions ?
[quoted text clipped - 9 lines]
> Regds
> Gurminder
Gurminder - 30 Aug 2004 09:03 GMT
Thanks Raghavendra.

But, I would like to add that we are not considering event log because, in
production sceanrios, event logs can often go full and also in mulitple
application scenario, mangaing those become a headache.

> Hi Gurminder,
>
[quoted text clipped - 38 lines]
> > Regds
> > Gurminder
David Levine - 30 Aug 2004 09:32 GMT
You can define your own backing store for the event log to reduce the
possibility of filling it up. Any logging you do has the potential of
overruning the store.

> Thanks Raghavendra.
>
[quoted text clipped - 26 lines]
> >
> > you can download the book from here.

http://www.microsoft.com/downloads/details.aspx?FamilyId=8A2E454D-F30E-4E72-B531
-75384A0F1C47&displaylang=en


> > Thanks
> > Raghavendra
[quoted text clipped - 12 lines]
> > > Regds
> > > Gurminder
Raghavendra  T V - 30 Aug 2004 10:33 GMT
Hi Gurminder,

Since you are saying that the log might get filledup you can also move the
contents of it to a backup file once it is full and notify the developer
through some mechanism.

Also have a look at the Microsoft Exception Management Block.
You can download it from the following link
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8CA8EB6E
-6F4A-43DF-ADEB-8F22CA173E02


Its a 600 Kb file

This gives you the option of logging errors into
-> System eventlog
-> Email notification ( error through email )
->  Database ( logging into database )

may be you can use a mixture of this depending on the scenario.

Also have a look at this
http://www.c-sharpcorner.com/ExceptionHandling.asp

interesting article to read on logging errors.
http://www.c-sharpcorner.com/Code/2003/Sept/CustomExceptionsUsingMSExpBlock.asp

Hope all this helps you in designing a better error logging mechanism.

Thanks
Raghavendra

> You can define your own backing store for the event log to reduce the
> possibility of filling it up. Any logging you do has the potential of
[quoted text clipped - 33 lines]
> > >
> > > you can download the book from here.

http://www.microsoft.com/downloads/details.aspx?FamilyId=8A2E454D-F30E-4E72-B531
-75384A0F1C47&displaylang=en


> > > Thanks
> > > Raghavendra
[quoted text clipped - 13 lines]
> > > > Regds
> > > > Gurminder
Nick Malik - 01 Sep 2004 07:45 GMT
In addition to the Exception Management Application Block, have a look at
the Logging Application Block.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/Logg
ing.asp

This uses the Enterprise Instrumentation Framework (EIF).

This is a more robust logging architecture.  While it is still capable of
logging to the event log, if you want to use it that way, the Logging
Application Block can take configurable adapters to log to anyplace you'd
like (flat files, SQL Server, TCP messages, whatever).  In addition, if a
log is not available, it can be configured to use a backup location.

It takes a little more work to use, but it is worth the effort if you really
want a fully thought-out logging solution.

--- Nick

BTW, Event logs can be configured so that they will discard old messages
rather than reject new ones.  Also, you can set up your own event log to log
events from your application, making it easy to manage.  I think this is
what Raghavendra was trying to say...

> Hi Gurminder,
>
[quoted text clipped - 4 lines]
> Also have a look at the Microsoft Exception Management Block.
> You can download it from the following link

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8CA8EB6E
-6F4A-43DF-ADEB-8F22CA173E02


> Its a 600 Kb file
>
[quoted text clipped - 9 lines]
>
> interesting article to read on logging errors.

http://www.c-sharpcorner.com/Code/2003/Sept/CustomExceptionsUsingMSExpBlock.asp

> Hope all this helps you in designing a better error logging mechanism.
>
[quoted text clipped - 40 lines]
> > > >
> > > > you can download the book from here.

http://www.microsoft.com/downloads/details.aspx?FamilyId=8A2E454D-F30E-4E72-B531
-75384A0F1C47&displaylang=en


> > > > Thanks
> > > > Raghavendra
[quoted text clipped - 14 lines]
> > > > > Regds
> > > > > Gurminder
Trilok Khairnar - 01 Sep 2004 13:36 GMT
Also look at http://logging.apache.org/log4net/

Regards,
Trilok.

> In addition to the Exception Management Application Block, have a look at
> the Logging Application Block.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/Logg
ing.asp

> This uses the Enterprise Instrumentation Framework (EIF).
>
[quoted text clipped - 22 lines]
> > Also have a look at the Microsoft Exception Management Block.
> > You can download it from the following link

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8CA8EB6E
-6F4A-43DF-ADEB-8F22CA173E02


> > Its a 600 Kb file
> >
[quoted text clipped - 9 lines]
> >
> > interesting article to read on logging errors.

http://www.c-sharpcorner.com/Code/2003/Sept/CustomExceptionsUsingMSExpBlock.asp

> > Hope all this helps you in designing a better error logging mechanism.
> >
[quoted text clipped - 46 lines]
> > > > >
> > > > > you can download the book from here.

http://www.microsoft.com/downloads/details.aspx?FamilyId=8A2E454D-F30E-4E72-B531
-75384A0F1C47&displaylang=en


> > > > > Thanks
> > > > > Raghavendra
[quoted text clipped - 15 lines]
> > > > > > Regds
> > > > > > Gurminder

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.