Skip to content

Commit

Permalink
Fix issue#4775 EventSourceException single event payload too large.
Browse files Browse the repository at this point in the history
  • Loading branch information
imcarolwang authored and mconnew committed Jan 25, 2022
1 parent 997e002 commit ee6c602
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/System.Private.ServiceModel/src/Internals/TraceCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace System.Runtime

internal partial class TraceCore
{

private const int MaxExceptionStringLength = 28 * 1024;
static System.Resources.ResourceManager resourceManager;

static System.Globalization.CultureInfo resourceCulture;
Expand Down Expand Up @@ -74,7 +74,7 @@ internal static bool HandledExceptionIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void HandledException(EtwDiagnosticTrace trace, string param0, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.HandledException(param0, serializedException);
}

Expand Down Expand Up @@ -110,7 +110,7 @@ internal static bool ThrowingExceptionIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void ThrowingException(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.ThrowingException(param0, param1, serializedException);
}

Expand All @@ -133,7 +133,7 @@ internal static bool UnhandledExceptionIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void UnhandledException(EtwDiagnosticTrace trace, string param0, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.UnhandledException(param0, serializedException);
}

Expand Down Expand Up @@ -261,7 +261,7 @@ internal static bool HandledExceptionWarningIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void HandledExceptionWarning(EtwDiagnosticTrace trace, string param0, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.HandledExceptionWarning(param0, serializedException);
}

Expand Down Expand Up @@ -369,7 +369,7 @@ internal static bool HandledExceptionErrorIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void HandledExceptionError(EtwDiagnosticTrace trace, string param0, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.HandledExceptionError(param0, serializedException);
}

Expand All @@ -392,7 +392,7 @@ internal static bool HandledExceptionVerboseIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void HandledExceptionVerbose(EtwDiagnosticTrace trace, string param0, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.HandledExceptionVerbose(param0, serializedException);
}

Expand All @@ -415,7 +415,7 @@ internal static bool EtwUnhandledExceptionIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void EtwUnhandledException(EtwDiagnosticTrace trace, string param0, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.EtwUnhandledException(param0, serializedException);
}

Expand All @@ -439,7 +439,7 @@ internal static bool ThrowingEtwExceptionIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void ThrowingEtwException(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.ThrowingEtwException(param0, param1, serializedException);
}

Expand All @@ -463,7 +463,7 @@ internal static bool ThrowingEtwExceptionVerboseIsEnabled(EtwDiagnosticTrace tra
/// <param name="exception">Exception associated with the event</param>
internal static void ThrowingEtwExceptionVerbose(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.ThrowingEtwExceptionVerbose(param0, param1, serializedException);
}

Expand All @@ -487,7 +487,7 @@ internal static bool ThrowingExceptionVerboseIsEnabled(EtwDiagnosticTrace trace)
/// <param name="exception">Exception associated with the event</param>
internal static void ThrowingExceptionVerbose(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception)
{
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);
WcfEventSource.Instance.ThrowingExceptionVerbose(param0, param1, serializedException);
}
}
Expand Down

0 comments on commit ee6c602

Please sign in to comment.