Skip to content

Commit c0c7e39

Browse files
authored
dont log Ignoring request with Size null (#1348)
1 parent 3d186db commit c0c7e39

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Features
66

7+
- Dont log "Ignoring request with Size" when null ([#1348](https://github.com/getsentry/sentry-dotnet/pull/1348))
78
- Move to stable v6 for `Microsoft.Extensions.*` packages ([#1347](https://github.com/getsentry/sentry-dotnet/pull/1347))
89

910
### Fixes

src/Sentry.AspNetCore.Grpc/ProtobufRequestExtractionDispatcher.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ public ProtobufRequestExtractionDispatcher(IEnumerable<IProtobufRequestPayloadEx
7272
return null;
7373
}
7474

75-
_options.Log(SentryLevel.Warning,
76-
"Ignoring request with Size {0} and configuration RequestSize {1}", null, request.ContentLength, size);
77-
7875
return null;
7976
}
8077
}

src/Sentry/Extensibility/RequestBodyExtractionDispatcher.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ public RequestBodyExtractionDispatcher(IEnumerable<IRequestPayloadExtractor> ext
7070
return null;
7171
}
7272

73-
_options.LogWarning("Ignoring request with Size {0} and configuration RequestSize {1}",
74-
request.ContentLength, size);
73+
if (request.ContentLength is not null)
74+
{
75+
_options.LogWarning("Ignoring request with Size {0} and configuration RequestSize {1}",
76+
request.ContentLength, size);
77+
}
7578

7679
return null;
7780
}

0 commit comments

Comments
 (0)