Dev2.Instrumentation.Tracker.TrackException C# (CSharp) Method

TrackException() public static method

Tracks and logs exceptions from within your code.
public static TrackException ( string className, string methodName, Exception ex ) : void
className string The class name from which the error originated. If the length of the string is greater than 50 it will be truncated.
methodName string The method name from which the error originated. If the length of the string is greater than 50 it will be truncated.
ex System.Exception The handled exception.
return void
        public static void TrackException(string className, string methodName, Exception ex)
        {
            if (AppSettings.CollectUsageStats)
            {
                var idx = className.LastIndexOf('.');
                var newClassName = className.Substring(idx + 1);
                newClassName = newClassName.Replace("`", "").Replace("1", "");
                TrackEvent(TrackerEventGroup.Exception, string.Format("{0}.{1}", newClassName, methodName));
            }

        }