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

chore: Eliminate "No matching wrapper" message when MEL is disabled #2564

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

tippmar-nr
Copy link
Member

@tippmar-nr tippmar-nr commented Jun 18, 2024

When MEL instrumentation has been disabled in favor of another logging provider, we will no longer emit the (mildly confusing) message:

No matching wrapper found for Microsoft.Extensions.Logging.Logger.Log(Microsoft.Extensions.Logging.LogLevel,Microsoft.Extensions.Logging.EventId,!!0,System.Exception,System.Func`3[!!0,System.Exception,System.String]) in assembly [Microsoft.Extensions.Logging, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60] (requested wrapper name was MicrosoftLogging). This usually indicates misconfigured instrumentation. This method will be ignored.

@nrcventura
Copy link
Member

Would the changes be simpler and more testable if the MEL wrapper was still enabled, but behaved as a noop instead? The changes would at least be isolated to a single wrapper.

@tippmar-nr
Copy link
Member Author

Would the changes be simpler and more testable if the MEL wrapper was still enabled, but behaved as a noop instead? The changes would at least be isolated to a single wrapper.

So just have BeforeWrappedMethod() return Delegates.NoOp when it's "disabled"? That does seem like a much simpler solution...

@tippmar-nr tippmar-nr changed the title chore: Suppress "No matching wrapper" message when MEL is disabled chore: Eliminate "No matching wrapper" message when MEL is disabled Jun 18, 2024
@tippmar-nr tippmar-nr enabled auto-merge (squash) June 18, 2024 20:05
@tippmar-nr tippmar-nr merged commit 329fd59 into main Jun 18, 2024
93 checks passed
@tippmar-nr tippmar-nr deleted the chore/mel-debug-message-suppress branch June 18, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants