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

Remove assembly full name from generated HttpClient name #1467

Open
yohny opened this issue Jan 16, 2023 · 1 comment
Open

Remove assembly full name from generated HttpClient name #1467

yohny opened this issue Jan 16, 2023 · 1 comment

Comments

@yohny
Copy link

yohny commented Jan 16, 2023

When Refit is used with a logging library like serilog that logs the context of a log message (typically a class where log originated) the generated Refit HttpClient name causes log to be hard to read as its very long.
An example of the generated name: System.Net.Http.HttpClient.Refit.Implementation.Generated+SerilogRefiReproControllersIApi, SerilogRefiRepro, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
The implementation is in

var assmQualified = $"{refitTypeName}, {refitInterfaceType.Assembly.FullName}";
where its clear that asembly full name is appended.
I asked for reasoning of such naming in discussion #1464, but got no answer.
Related issue in serilog that resulted in this feature request serilog/serilog#1793

Describe the solution you'd like
The generated class name would be simlified - no asembly full name would be present.

@soarwing52
Copy link

I'd like to know if there's a way to stop the log with this logger name
I use a custom DelegatingHandler as LogginHandler, and wont require the logger of System.Net.Http.HttpClient.Refit.Implementation.*

I tried to filer the name but it just always log
{ "time": "2023-09-05 17:52:32.4068", "level": "INFO", "logger": "System.Net.Http.HttpClient.Refit.Implementation.Generated+GtrPlatformExtendApisIConsultantApiClient, Gtr.Platform.ExtendApis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.LogicalHandler", "message": "End processing HTTP request after 73.0084ms - 200" } { "time": "2023-09-05 17:52:32.4068", "level": "INFO", "logger": "System.Net.Http.HttpClient.Refit.Implementation.Generated+GtrPlatformExtendApisIConsultantApiClient, Gtr.Platform.ExtendApis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.ClientHandler", "message": "Received HTTP response headers after 32.7993ms - 200" }

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

No branches or pull requests

2 participants