Home
> Uncategorized > Remote #ErrorLogging in C#
Remote #ErrorLogging in C#
If you are running a C# Application on a client’s machine, and can’t run the debugger on it, then instead of asking your client to send you log files whenever something goes wrong, you can use a remote logging service to record error events, and view them, and even act on them before the client complains.
This example uses RemoteLogCat.com – a logging service designed for Android, but works equally well in C# / .NET. You will need to have an API Key, and store it as a setting as “RemoteLogCat” in your web.config / app.config
public class Logging{public static string key = ConfigurationManager.AppSettings[“RemoteLogCat”];public static void Log(string channel, string log){var strUrl = “http://www.remotelogcat.com/log.php?apikey={0}&channel={1}&log={2}”;strUrl = string.Format(strUrl, key, channel, log);var wc = new WebClient();wc.DownloadString(strUrl);}}
This is then called using
Logging.Log(“MyApp”,”Your Error”)
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback