Coder Social home page Coder Social logo

Configuration for Logging about cachemanager HOT 2 CLOSED

michaco avatar michaco commented on June 15, 2024
Configuration for Logging

from cachemanager.

Comments (2)

MichaCo avatar MichaCo commented on June 15, 2024

See this example: https://github.com/MichaCo/CacheManager/blob/dev/samples/CacheManager.Examples/Program.cs#L89

For some reason, the rc1 release of MS Logging uses Debug level as Verbose. They changed it already in rc2 so until rc2 is released and I upgraded the logging package, you have to use debug as the minimum log level to get verbose log messages.

For some strange reason, in rc1, you also have to set the min log level of the logger factory to Debug, otherwise it will not log those messages (this will change in rc2, too)

Try add f.MinimumLevel = LogLevel.Debug; within the WithMicrosoftLogging builder

from cachemanager.

gthelp avatar gthelp commented on June 15, 2024

That worked. I had seen that information, but I put the minimum level in the wrong place. Here is my startup.cs settings for anyone else who has run in to this issue. Thanks for the quick response.

//https://github.com/MichaCo/CacheManager
var cache = CacheFactory.Build("cacheName", settings => settings
.WithMicrosoftLogging(f =>
{
f.MinimumLevel = LogLevel.Debug;
f.AddConsole(minLevel: LogLevel.Debug);
f.AddDebug(minLevel: LogLevel.Debug);
})
.WithJsonSerializer()
.WithUpdateMode(CacheUpdateMode.Full)
//.WithSystemRuntimeCacheHandle("inProcessCache").And //use local cache and sync with redis
.WithRedisConfiguration("redis", config =>
{
config.WithAllowAdmin()
.WithDatabase(0)
.WithEndpoint("redistest", 6379);
})
.WithMaxRetries(1000)
.WithRetryTimeout(100)
//.WithRedisBackplane("redis").WithRedisCacheHandle("redis", true)
.WithRedisCacheHandle("redis", false)
.WithExpiration(ExpirationMode.Sliding, TimeSpan.FromMinutes(30)) /allow 30 minutes unused cache before blast/
//.EnableStatistics().EnablePerformanceCounters()
);
services.AddSingleton<ICacheManager>(serviceProvider => cache);

from cachemanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.