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

.Net: Create a classifiable Kernel Function logger. #5989

Open
jichulu opened this issue Apr 24, 2024 · 1 comment · May be fixed by #6011
Open

.Net: Create a classifiable Kernel Function logger. #5989

jichulu opened this issue Apr 24, 2024 · 1 comment · May be fixed by #6011
Assignees
Labels
enhancement .NET Issue or Pull requests regarding .NET code

Comments

@jichulu
Copy link

jichulu commented Apr 24, 2024

In file semantic-kernel/dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs when create logger, add a prefix to the name of the Logger for logging filtering.

line 160 and line 303.

make ILogger logger = kernel.LoggerFactory.CreateLogger(this.Name) ?? NullLogger.Instance;
to ILogger logger = kernel.LoggerFactory.CreateLogger("Microsoft.SemanticKernel.KernelFunction." + this.Name) ?? NullLogger.Instance;

So we can easy to filter logging via config

{
    "Logging": {
        "LogLevel": {
            "Microsoft.SemanticKernel.KernelFunction": "Warning"
        }
    }
}
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Apr 24, 2024
@github-actions github-actions bot changed the title Create a classifiable Kernel Function logger. .Net: Create a classifiable Kernel Function logger. Apr 24, 2024
@markwallace-microsoft markwallace-microsoft self-assigned this Apr 29, 2024
@RogerBarreto
Copy link
Member

I think that makes a lot of sense, +1. 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement .NET Issue or Pull requests regarding .NET code
Projects
Status: Sprint: In Progress
4 participants