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

  • Home
  • SEARCH
  • 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 1003035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:55:02+00:00 2026-05-16T07:55:02+00:00

When I log errors, I typically include the stack trace. This is good, but

  • 0

When I log errors, I typically include the stack trace. This is good, but often, it’s difficult to tell where the error actually is.

Is it possible to set up a routine that collects, perhaps via reflection, the parameters, the local variables, etc… at the time the error has occurred?

  • 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-05-16T07:55:03+00:00Added an answer on May 16, 2026 at 7:55 am

    If you don’t have VS2010, you can use PostSharp to weave in code to collect parameters as functions are called. It will slow down code, though, so it’s only useful for debugging.

    EDIT: (promoting this from a comment I just made)

    If you want to use this in production, you can either limit the scope of the PostSharp weaving, so it only operates on certain classes/namespaces/assemblies (or even functions), or you can limit what you do when your advice is executed. One thing I tried, but didn’t fully follow through on, was to have the advice methods simply record stack frame information in a ring buffer. When an exception occurs, your logger can grab the stack frame information from the ring buffer and generate a suitable log message. Otherwise, the frame information is just overwritten as the ring buffer fills up. You could even just use a stack instead of a ring buffer and have that stack grow and shrink, recording frame info, as the call stack grows and shrinks. Caveat: you won’t be able to get frame information from framework code or 3rd party code that can’t be modified by PostSharp.

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

Sidebar

Related Questions

I have many errors in my apache error log like this: [Mon Mar 26
I want to log/write all Javascript errors to a text file whenever an error
direct console to ok.log, and errors to error.log for example
Currently my application is using log4net to log errors, the web.config for this is
Probably trivial question.. I want to implement my own error handler to log errors
Is there a project that can log errors in requests to Django on Google
My application uses HttpURLConnection to connect to my REST services. I log errors and
Is there an easy way to log PHP errors to a log for a
I want to log some seemingly random errors I'm getting in a Delphi written
I keep seeing errors in the Dev Server console log about the Datastore Admin

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.