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 8293455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:50:01+00:00 2026-06-08T13:50:01+00:00

We log our processes for debugging purposes, and use reflection to get the method

  • 0

We log our processes for debugging purposes, and use reflection to get the method name for logging. Currently, I call the logging method with a parameter of System.Reflection.MethodInfo, and inside the logging method it parses that parameter to use Method.DeclaringType.Name to get the name of the class the method lives in (and also Method.Name, which isn’t an issue at the moment). What I get from this is the ancestor name, and I want the descendant (even though the method being used is not overridden and is run directly from the ancestor). Is this possible? I went scrounging through the reflection information but didn’t find the descendant name anywhere.

I am not concerned about the performance issues of Reflection, and I’m willing to add additional parameters to the logger method if necessary to get the information I need.

Thanks!

  • 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-08T13:50:04+00:00Added an answer on June 8, 2026 at 1:50 pm

    No, you’re not going to get that from the MethodInfo. You should pass in this, at which point the logging code can call GetType() to find the actual type of the object.

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

Sidebar

Related Questions

I have a problem with a client, who cannot log in to our system.
Our whole system is being designed around REST and are now considering how processes
We use the logging application block in our ASP.NET 2.0 application which is called
How to log our own error messages (for ex: error due to invalid user
I've been using log4net to log our ASP.NET web site's log messages, and lately
Our users log into the production database as a fairly low-level user, with SELECT
How can we save log-file of our application actions on SD-card? We should have
It's a third party application generating huge amounts of log entries on our app
For our assignment we are given a copy of a wtmp log, and are
Our environment: Drupal+MySQL Examining the query log indicates that the following query, originating from

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.