Getting SonarQube warning message "S4792: Make sure that this logger's configuration is safe"

Contributor

 

Getting the sonarqube warning message for logger safe for Startup files for both Azure function and Bot project . How to solve the warning issue to clear SonarQube issue

 

Aiswarya_Lakshmy_1-1674227328396.png

 

 

3 Replies
@Aiswarya_Lakshmy - Are you developing any teams app?
If yes, then Could you please elaborate your requirement and share the repro steps, so that we can try it from our end?

@Sayali-MSFT 

 

We are developing a chat bot application and below is the Program.cs code,

 

 

    public static class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.ConfigureLogging((logging) =>
                    {
                        logging.AddDebug();
                        logging.AddConsole();
                    });
                    webBuilder.UseStartup<Startup>();
                });
    }

 

 

For this code, we are seeing Sonarqube warning "Make sure that this logger's configuration is safe."