Skip to content

[FEATURE] Add WithLogger extension method overloads to support non-generic ILogger #588

@tky753

Description

@tky753

Problem

I am currently using a custom ILogger implementation. However, due to some specific internal constraints, the T type in my implementation is fixed and cannot be dynamically changed. This makes it impossible to adapt to ILogger directly.
Since ILogger inherits from ILogger, would it be possible to change the logger type across FusionCache from the specific ILogger to the more general ILogger?

Solution

Add extension function
public static IFusionCacheBuilder WithLogger(this IFusionCacheBuilder builder, Func<IServiceProvider, ILogger> factory)
and
public static IFusionCacheBuilder WithLogger(this IFusionCacheBuilder builder, ILogger logger)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions