dotnet / dotnet/docs

Explanations required for this rule.

Open
#30,471 1 comment 0 reactions 0 assignees View on GitHub
dotnet-fundamentals/svc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
15h 21m
Merged PRs (30d)
370

Description

[Enter feedback here]
Hi,

It would be great to have an explanation on WHY this rule is in effect, I understand that positional parameter can be harmful in lengthy log message but not in short ones. So I don't really understand why I should force named parameter when I have only three parameters in my log.

ie : this.logger.LogInformation("Cache entry {0}_{1} exists : {2}", CacheId, requestId, result);

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 03da1d8e-6ed0-df80-4ae3-e5a04048cfcc
* Version Independent ID: 91a91bf7-90e8-4d62-2c2d-43eaef69db77
* Content: [CA2253: Named placeholders should not be numeric values - .NET](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2253)
* Content Source: [docs/fundamentals/code-analysis/quality-rules/ca2253.md](https://github.com/dotnet/docs/blob/main/docs/fundamentals/code-analysis/quality-rules/ca2253.md)
* Product: **dotnet-fundamentals**
* GitHub Login: @Youssef1313
* Microsoft Alias: **gewarren**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.