Issue
I use spring boot package to jar, and run java -jar xxx.jar --logging.config=xxx.xml
.
Now i package to war and deploy in tomcat, how can i pass logging.config
such arguments?
Solution
I think these articles could be usefull for you:
- https://www.middlewareinventory.com/blog/set-heapmemory-jvm-arguments-tomcat/
- https://tomcat.apache.org/tomcat-8.5-doc/config/context.html
In a shorthand, there a two options. First one is to use tomcat global JAVA_OPTS:
- Use
Setenv.sh
file to set JVM arguments to Tomcat instance - same as above, but using
Catalina.sh
The example change is like:
JAVA_OPTS="-Xms1024m -Xmx1024m -Xss228k -XX:+UseParallelGC"
Verify your changes by executing ps -eaf|grep -i java
command
Second one is to use Context
from Tomcat. Please refer to the Context Parameters
section of this document
Answered By - Szymon Dudziak
Answer Checked By - Gilberto Lyons (JavaFixing Admin)