Muhammad Hewedy
Muhammad Hewedy

Reputation: 30078

How to pass properties to tomcat through command line

I need to pass -Dlog4j.debug 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 

Upvotes: 2

Views: 2193

Answers (2)

adamski.pro
adamski.pro

Reputation: 68

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

Upvotes: 1

Marcos Placona
Marcos Placona

Reputation: 21730

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

Upvotes: 2

Related Questions