开发者

How to pass properties to tomcat through command line

开发者 https://www.devze.com 2022-12-24 12:35 出处:网络
I need to pass -Dlog4j.d开发者_运维知识库ebugto tomcat through command line, how to do that ??

I need to pass -Dlog4j.d开发者_运维知识库ebug to tomcat through command line, how to do that ?? The platform in Linux box, the command is $CATALINA_HOME/bin/startup.sh

I've tried set CATALINA_OPTS=-Dlog4j.debug=true but noway !!

The solution is :

export CATALINA_OPTS=-Dlog4j.debug=true 


I'm not sure how you're starting tomcat, but doing:

set CATALINA_OPTS=-Dlog4j.debug=true

And then starting it on the same command line, will do the job.

Hope this helps you


For permanent solution you can set it in $CATALINA_HOME/bin/setenv.sh

#!/bin/bash
CATALINA_OPTS="-Dlog4j.debug=true"

then run tomcat from any command-line $CATALINA_HOME/bin/startup.sh

0

精彩评论

暂无评论...
验证码 换一张
取 消