i'm developing a application using spring boot version 1.3.5 (spring 4.2.6). i use log4j2 version 2.4.1 as logging system. when working on sts (spring tool suite) and executing on embeeded tomcat, the logs works fine (on console and on file) but when building a war file and deploying it on external tomcat 8 the log file is created but my logs don't appear in it.
i've looked for similar issue and tested some solutions:
- setting the logging.config property on tomcat
- configuring 'application.properties' file with the parameter logging.config=classpath:log4j2-spring.xml
- using another logging framework (logback)
but none of this solution work. the post that talks about that is: Spring-Boot Logging configuration when deployed as .war
any help or detailled answer please.
If you want to configure log4j for your Spring Boot application inside Tomcat, this documentation may help you :
https://tomcat.apache.org/tomcat-8.5-doc/logging.html#Using_Log4j