Skip to content

How to configure logging to turn off console logging for Microsoft.KernelMemory.*? #804

Closed Answered by dluc
vksv asked this question in 1. Q&A
Discussion options

You must be logged in to vote

With memory builder you can use this:

var builder = new KernelMemoryBuilder()
            .Configure(builder => builder.Services.AddLogging(l =>
            {
                l.SetMinimumLevel(LogLevel.None);
            }))
           ...

or this, if you want to see errors:

var builder = new KernelMemoryBuilder()
            .Configure(builder => builder.Services.AddLogging(l =>
            {
                l.SetMinimumLevel(LogLevel.Error);
                l.AddSimpleConsole(c =>
                {
                    c.SingleLine = true;
                    c.UseUtcTimestamp = false;
                    c.TimestampFormat = "[HH:mm:ss.fff] ";
                });
            }))

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dluc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #798 on September 25, 2024 18:26.