1
votes

I packaged my application as spring-boot executable jar file. I added a logging.properties in the root directory inside the jar file but it seems this file didn't have any impact on the application. How can I configure spring-boot executable jar logging?

1
Refer this link javabeat.net/spring-boot-logging. If you are having a maven project, keep the log file in the resource folder and file name should be logback.xmlRonald Randon
It is using xml format but I want to use properties. All the loggers in my app are from java.util.logging.Logger, whether I can use java logging.properties to configure my logging?Joey Yi Zhao

1 Answers

0
votes

Spring Boot uses Logback as default for logging. So you don't need any extra configuration for logging until you need to do any customized logging or other loggers like Log4j2.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

    public class App 
    {
        private static final Logger logger = LoggerFactory.getLogger(App.class);    
        public static void main( String[] args )
        {
            logger.info("Hello Logger");
        }
    }

If you need to customize logging refer this like http://www.javabeat.net/spring-boot-logging/

I am not sure how to use the logger.properties. Why can't you use the logback.xml.