Search code examples
c#web-serviceserror-reportingerror-logging

What is the best way to send application errors and logs by internet to the developers?


As the author of a C# application, I found that troubleshooting issues reported by users would be much easier if I had access to the exception or debug logs.

I have included a home-grown logging mechanism that the user can turn on or off. I want the user to be able to submit the logs via the internet so I can review the logs for the error.

I have thought of using either SMTPClient or a web service to send the information. SMTPClient might not work because firewalls may block outgoing SMTP access. Would a web service has issue with sending a large amount of data (potentially 1+ MB)?

What would you recommend as the best way to have an application transmit error reports directly to developers for review?

EDIT: Clarification: This is a Windows application and when an error occurs I want to bring up a dialog asking to submit the error. My question is about the mechanism to transmit the error log from the application to me (developer) via the internet.


Solution

  • We use 3 methods where I work

    • SMTP to a dedicated mailbox. This requires a lot of configuration and dancing around with "big corporate" IT departments to work out what their mail server is and how to authenticate against it and send through it. Then there's programs like Norton Internet Security that can block outbound SMTP traffic on the client machine which throw extra spanners in the works.
    • Submission to an asmx on our server. This is our preferred method, but lots of things can get in the way. It's mainly proxies, but Norton can also step in and swat you down. If there's a proxy involved, run away run away :-)
    • HTTP POST using HttpWebRequest and mime typ of multipart/form-encoded. It also has proxy and firewall issues, but can sometimes work where asmx submission fails.

    Good luck. You're right in that it's much easier to debug if you've got the stack trace and perhaps even a screenie of what the poor old user was doing.