From f369aabd6bf2bf8ef8726775193e38e2033ab95e Mon Sep 17 00:00:00 2001 From: VahidN Date: Sun, 31 Mar 2024 11:00:14 +0330 Subject: [PATCH] Enable logging when `cacheableEvent` is not null --- .../EFCoreSecondLevelCacheInterceptor.csproj | 2 +- src/EFCoreSecondLevelCacheInterceptor/EFDebugLogger.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EFCoreSecondLevelCacheInterceptor/EFCoreSecondLevelCacheInterceptor.csproj b/src/EFCoreSecondLevelCacheInterceptor/EFCoreSecondLevelCacheInterceptor.csproj index d9b8613..37ce4ef 100644 --- a/src/EFCoreSecondLevelCacheInterceptor/EFCoreSecondLevelCacheInterceptor.csproj +++ b/src/EFCoreSecondLevelCacheInterceptor/EFCoreSecondLevelCacheInterceptor.csproj @@ -1,7 +1,7 @@ Entity Framework Core Second Level Caching Library. - 4.3.0 + 4.3.1 Vahid Nasiri net8.0;net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0;net462;netcoreapp3.1; true diff --git a/src/EFCoreSecondLevelCacheInterceptor/EFDebugLogger.cs b/src/EFCoreSecondLevelCacheInterceptor/EFDebugLogger.cs index be8bdbc..5b65dd6 100644 --- a/src/EFCoreSecondLevelCacheInterceptor/EFDebugLogger.cs +++ b/src/EFCoreSecondLevelCacheInterceptor/EFDebugLogger.cs @@ -28,7 +28,7 @@ public EFDebugLogger(IOptions cacheSettings, ILo var disableLogging = cacheSettings.Value.DisableLogging; _cacheableEvent = cacheSettings.Value.CacheableEvent; - IsLoggerEnabled = !disableLogging && logger.IsEnabled(LogLevel.Debug); + IsLoggerEnabled = !disableLogging && (_cacheableEvent is not null || logger.IsEnabled(LogLevel.Debug)); if (IsLoggerEnabled) {