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

[C#] Avoid logger instantiations per request #40553

Closed
AliKhalili opened this issue Mar 14, 2024 · 1 comment
Closed

[C#] Avoid logger instantiations per request #40553

AliKhalili opened this issue Mar 14, 2024 · 1 comment

Comments

@AliKhalili
Copy link
Contributor

AliKhalili commented Mar 14, 2024

Describe the enhancement requested

In .NET, the method CreateLogger<T>(src) yields an instance of ILogger<T> and consistently generates a fresh Logger<T> object. On the other hand, invoking CreateLogger(typeof(T))(src) results in a non-generic ILogger instance and defers to the factory's CreateLogger method, usually without creating a new instance.

It would be beneficial to modify this behavior within the FlightSqlServer base class to prevent the allocation of a new logger with each request.

Component(s)

C#

CurtHagenlocher pushed a commit that referenced this issue Mar 18, 2024
### What changes are included in this PR?

- Replacing `CreateLogger<FlightSqlServer>` with `CreateLogger(typeof(FlightSqlServer))`

### Are these changes tested?

It is not gonna change any behavior 

### Are there any user-facing changes?

No

* GitHub Issue: #40553

Authored-by: Ali Khalili <ali.khalili@truelayer.com>
Signed-off-by: Curt Hagenlocher <curt@hagenlocher.org>
@CurtHagenlocher
Copy link
Contributor

Issue resolved by pull request 40554
#40554

@CurtHagenlocher CurtHagenlocher added this to the 16.0.0 milestone Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants