Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue#4775 EventSourceException single event payload too large. #4776

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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