Skip to content

EndpointRoutingMiddleware request size log names need improvement #49734

Closed
@JamesNK

Description

@JamesNK

#49233 adds new log messages to EndpointRoutingMiddleware. The names could be more descriptive.

[LoggerMessage(8, LogLevel.Debug, $"The endpoint does not specify the {nameof(IRequestSizeLimitMetadata)}.", EventName = "MetadataNotFound")]
public static partial void MetadataNotFound(ILogger logger);
[LoggerMessage(9, LogLevel.Warning, $"A request body size limit could not be applied. This server does not support the {nameof(IHttpMaxRequestBodySizeFeature)}.", EventName = "FeatureNotFound")]
public static partial void FeatureNotFound(ILogger logger);
[LoggerMessage(10, LogLevel.Warning, $"A request body size limit could not be applied. The {nameof(IHttpMaxRequestBodySizeFeature)} for the server is read-only.", EventName = "FeatureIsReadOnly")]
public static partial void FeatureIsReadOnly(ILogger logger);

MetadataNotFound should say what metadata is not found. FeatureNotFound should say what feature is not found.

Also, IMO, MetadataNotFound could be logged at a Trace level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions