-1

My spring application start's via WebApplicationInitializer.

public class WebAppInitializer implements WebApplicationInitializer
{
    @Override
    public void onStartup(ServletContext servletContext) throws ServletException
    {
       ....
    }
}

I have Config class

@Configuration
@PropertySources({
    @PropertySource(value = "classpath:application.properties"))
})
public class MainConfig
{
  ....
}

And in application.properties file I try to override the spring and logging properties

logging.level.com.app=DEBUG
logging.level.org.springframework.web=DEBUG

The file application.properties is in the directory src/main/resources

But it has no effect - means that no property is applied to the spring or logging system

kidar2
  • 124
  • 4
  • 14

1 Answers1

-1

Try using SpringBoot. In spring boot application.properties is read by default and you don't even need to use @PropertySource to read it. You can download a spring boot application skeleton from https://start.spring.io/

Peter Szanto
  • 7,568
  • 2
  • 51
  • 53