Spring-Boot externalize logback configuration file (logback-spring.xml)
Many times there is a need to externalize the logging configuration file in spring boot, so that without making any code level/ jar level changes we can easily change the logging configuration. For example If we deliver any spring boot application as a jar we dont want the logging file name to be hardcoded and to be present on any specific location, so If we have an opportunity to change the logging configuration file we can easily set the logging file location or name. Or take another example where we want to change the logging level or add logger for a new package we can easily do it if logging configuration file is externalized. Lets see how we can externalize logback loggin configuration file - Spring boot by default uses logback for logging and If we don't provide any configuration file It uses default configuration and prints logs in console. So if we want to make changes to the logback configuration we will have to create a logbacl configuration file. Follow below steps ...