/// <summary> /// Logs the exception using <see cref="AzureGatewaySemanticEventSource" />. /// </summary> /// <param name="eventSource">The event source to be used for problem reporting.</param> /// <param name="className">Name of the class.</param> /// <param name="methodName">Name of the method.</param> /// <param name="e">The exception to be reported.</param> internal static void LogException(this AzureGatewaySemanticEventSource eventSource, string className, Exception e, [CallerMemberName] string methodName = nameof(LogException)) { Exception _exception = e; string _innerText = "An exception has been caught:"; while (e != null) { eventSource.ProgramFailure(className, methodName, $"{_innerText} of type {_exception.GetType().Name} capturing the message: {e.Message}"); e = e.InnerException; _innerText = "It contains inner exception:"; } }
/// <summary> /// Gets the part event source. /// </summary> /// <returns>Returns an instance of <see cref="EventSource" />.</returns> public EventSource GetPartEventSource() { return(AzureGatewaySemanticEventSource.Log()); }