Forum Discussion
Lakshmi_145
Jan 20, 2023Brass Contributor
Getting SonarQube warning message "S4792: Make sure that this logger's configuration is safe"
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
- Sayali-MSFTMicrosoftLakshmi_145 - 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?- Lakshmi_145Brass Contributor
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."
- Sayali-MSFTMicrosoft
Lakshmi_145 -
According to SonarQube rules, This rule flags for review code that initiates loggers configuration.
Please have look into this thread-
1.logging - Sonar issue: Make sure that this logger's configuration is safe - Stack Overflow
2. Make sure that this logger's configuration is safe. (#598) · Issues · Kennedy Sanchez / Web-Security-Bug-Hunting-Trainings · GitLab