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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:25:30+00:00 2026-05-18T02:25:30+00:00

We’re trying to create a simple to use webservice for logging exceptions and messages.

  • 0

We’re trying to create a simple to use webservice for logging exceptions and messages.

Ideally the web methods declaration would look like this

public int LogException(MethodBase methodBase, Exception exception)
public int LogMessage(MethodBase methodBase, string message, string data)

But that doesn’t work, since when you add a reference to a webservice it creates it’s own classes and System.Reflection.MethodBase is not the same type as LogService.MethodBase. And neither MethodBase or Exception serialize nicely. And I also want exception to have it’s Data values.

How would you go about passing those two objects to a webmethod?

The reason we were hoping to just pass those two objects is, between them, we can get 99% of the data needed to trace an error. They contain stack trace info, methodnames and the class they are in, etc, etc… And by adding some information to Exception.Data, you can have the parameters values at the time of the call. And, this simplifies the call for other devs, and hopefully makes them more likely to use a common logger, rather than always rolling their own. Which currently, is proving to be troublesome as each logger is different, and most don’t seem to include ALL the details necessary to track down an error.

By doing this, we can standardize the values returned, and email format, and make changes to all apps logging by changing one service.

  • 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-18T02:25:30+00:00Added an answer on May 18, 2026 at 2:25 am

    Please don’t do this.

    You should not use web services to pass platform-specific data. MethodBase etc are specific to .NET, and the web service infrastructure is not intended to accommodate it.

    Why do you want a web service to do logging? Use a class library instead. You don’t want your logging to fail because of problems with a web service.

    Finally, if you must do this, don’t use ASMX web services to do it – use WCF, which will allow you to use the same type on both the client and the service.

    Perhaps more importantly, WCF will allow you to use MSMQ as a transport, so that you can use reliable queues to ensure that your log messages are eventually logged.

    I still doubt that you really want to send the MethodBase – send the data that’s in the MethodBase, instead. What will you do about .NET version dependencies?

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to create an if statement in PHP that prevents a single post
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string

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.