0

I'd like to enable DEBUG log level of my spring boot application. Like mentioned in this answer https://stackoverflow.com/a/74678907/8315843, it's possible by modifying application.properties and rebuilding, repackaging and redeploying. Is it possible to do the same by just changing a command line option such as a VM property and restarting ?

I use slf4j logging with code such as this :

    private final Logger logger = LoggerFactory.getLogger(getClass());

Please note, I'm not talking about the spring boot framework log level that can be set with a --debug, but the log level of the application that uses its org.slf4j.Logger and its own calls to logger.debug.

Sybuser
  • 735
  • 10
  • 27

1 Answers1

1

Not a VM property, but a command-line option :

--logging.level.root=debug
Sybuser
  • 735
  • 10
  • 27
  • Any other way to specify a Spring Boot environment property (cf. [documentation](https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config)) will also work. E.g. `-Dlogging.level.root=debug` – Piotr P. Karwasz Jan 06 '23 at 19:34