spring-cloud-commons icon indicating copy to clipboard operation
spring-cloud-commons copied to clipboard

Displaying all the configuration in the log with info logger level

Open muqtharali opened this issue 4 years ago • 11 comments

In org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration class, displaying all the properties read from config server using the below log statement. I think we can stop displaying all the properties read from configuration file or spring cloud config server which will get displayed in Kibana or Grafana dashoboard.

At least we can change the logger level to debug so that in the production logs, we don't see all the values.

Statement logger.info("Located property source: " + sourceList);

Jar: spring-cloud-context-2.2.2.RELEASE.jar Class: org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration

muqtharali avatar May 04 '21 11:05 muqtharali

PRs welcome

spencergibb avatar Jun 03 '21 18:06 spencergibb

I'd recommend displaying the source names on info and the properties on debug

spencergibb avatar Jun 03 '21 18:06 spencergibb

Hey, @spencergibb @muqtharali I'd like to help out with this issue if possible. I've contributed to spring-cloud-dataflow and was looking at some other projects to contribute to when I came across this one.

siddhantsorann avatar Jun 07 '21 17:06 siddhantsorann

@siddhantsorann assigned to you.

spencergibb avatar Jun 07 '21 17:06 spencergibb

@spencergibb Since I'm new to this project, could you give me a quick idea of what's to be done? I can see only one log line in this class.

siddhantsorann avatar Jun 07 '21 17:06 siddhantsorann

We can have a log line to stream the source list and print all property names and a debug one to print the source as well? Does that work?

siddhantsorann avatar Jun 07 '21 17:06 siddhantsorann

yes, the idea is having info be short and debug have everything that is there now.

spencergibb avatar Jun 07 '21 17:06 spencergibb

@spencergibb @siddhantsorann As per understanding, we can remove the below log statement logger.info("Located property source: " + sourceList); Also add the info statement for property name and if required add the debug statement for property value.

muqtharali avatar Jun 08 '21 05:06 muqtharali

Thanks for the info @muqtharali & @spencergibb. From what I could understand I have created the above Pull Request. Let me know if it's okay.

siddhantsorann avatar Jun 08 '21 05:06 siddhantsorann

@Siddhantsorann From my side, it looks good. But I have one query, do we really need debug for property values?

muqtharali avatar Jun 27 '21 17:06 muqtharali