Hello Hemanth Kumar Reddy Rachala,Welcome to microsoft Q&A, thankyou for posting your query here.
Serilog logging for ASP.NET Core. This package routes ASP.NET Core log messages through Serilog, so you can get information about ASP.NET's internal operations written to the same Serilog sinks as your application events.
With Serilog.AspNetCore installed and configured, you can write log messages directly through Serilog or any ILogger interface injected by ASP.NET. All loggers will use the same underlying implementation, levels, and destinations.
install the Serilog.AspNetCore and Serilog console NuGet packages into your app.
dotnet add package Serilog.AspNetCore
dotnet add package Serilog.Sinks.Console
follow this links to configure
https://github.com/serilog/serilog-aspnetcore
https://github.com/serilog/serilog-sinks-console
Enable Azure Monitor for Containers for your AKS cluster.
When you deploy your .NET Core API application to AKS, the logs written to the console by Serilog will be captured automatically by Azure Monitor for Containers.
You can use this query under AKS -insights -logs to view your application logs.
ContainerLog
| where LogEntry contains "ERROR"
Hope this helps you.
If an answer has been helpful, please consider accepting the answer to help increase visibility of this question for other members of the Microsoft Q&A community. If not, please let us know what is still needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!