How to solve below Security Hotspot Error raised for logging?

How to solve the below shown security-hotspot error raised for logging, best method to loggingin python within sonarqube-rules

FORMAT=(“%(asctime)s:%(filename)s:%(funcName)s:%(lineno)d:%(message)s”)
logging.baseConfig(stream=sys.stdout, format = FORMAT, level = logging.DEBUG)

Must-share information (formatted with Markdown):

  • which versions are you using ----> SonarQube
  • how is SonarQube deployed ----> Docker
  • what are you trying to achieve ----> How to solve this Security Hotspot
  • what have you tried so far to achieve this ----> Tried different suggestions given in Sonarqube.

I am using logging module in python as the logger. When I ran the package through Sonarqube for the code smells and security hotspots, I found out that there was a security hotspot raised which was due to logging instantiation.

Hi,

Welcome to the community!

I like to call Security Hotspots “Schroedinger’s Vulnerabilities”. Meaning that each Security Hotspot might represent a security problem. It might not. You won’t know until you’ve looked at it. It takes human intelligence to understand the context and decide. So if, on review, you feel there’s no problem here, you can simply mark it “Safe” and move on.

 
HTH,
Ann