Search code examples
javaspring-bootlogback

Logback programmatic configuration


I am configuring logback programmatically. I am also using Spring Boot, and I would like to set the logs location in application.properties. I know in XML there is a springProperty tag, where is this in the Java API?


Solution

  • in spring-boot you can define logging config in application.properties

    logging.path = /path/to/folder/log
    

    logfile would then be named spring.log

    [Using logging.path] Writes spring.log to the specified directory. Names can ?be an exact location or relative to the current directory.

    Here: is nice article about logging with springboot