Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9242599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:36:48+00:00 2026-06-18T08:36:48+00:00

I have an enterprise application that logs exception information whenever one happens to occur.

  • 0

I have an enterprise application that logs exception information whenever one happens to occur. The application is a combination of C#, and C++.net.

I want to get as much information as I can at the time of the exception. As of right now, we only print out the Message and the stack trace (which gives line numbers in debug builds, but not release).

The goal of any error log is to point out the error to the best of its ability (as close as it can get). I’m curious how I can take this farther? I want more info.

As a for-instance, I know NullReferenceExceptions and InvalidArguementExceptions contain different amounts of information, but I’m not harnessing anything besides the ‘Message’ Field.

Is my best bet to use reflection and capture all the public members and print them out? Or perhaps chain TONS of type-checks and casts to print them out cleanly? As a constraint, my logging function needs to just take in an argument of type Exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:36:49+00:00Added an answer on June 18, 2026 at 8:36 am

    In general, the answer is to log ex.ToString(). In general, the ToString method of an object displays what the object wants you to know. In the case of the base Exception class, this includes the message and stack trace, in addition to the same for any InnerException instances. Particular derived classes of Exception may display more information.

    Some exceptions like SqlException also capture additional information (like the stored procedure name and linenumber). In these cases, it it helpful to serialize the entire exception and save that as XML in your logging database. Note that not all exception classes can be serialized, so be prepared to punt on the XML portion.

    Also, if all you’re doing is logging the exception, then you may want to rethrow the exception so that higher levels can have a chance to handle it. Of course, this does not apply when you are already at the “top level”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build an enterprise application that will have very large number of
We have an enterprise application written in asp.net c# (3.5) and SQL server that
Does MS have a sample enterprise application that demonstrates the use of different Enterprise
I have a typical enterprise/business application that I am developing that includes orders, salespersons,
I already have an enterprise Java EE application. I want expose some of the
I have an old (around 5 years) enterprise application that I manage. Recently we
I have an Enterprise Application with an EJB implementing a @Remote business interface that
have a weird situation. I'm using Glassfish server for my Enterprise application. In that
I have a Java enterprise application that provides a web service, has a domain
I'm developing an enterprise-like application that fetches data from a remote server. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.