[jboss-jira] [JBoss JIRA] (WFLY-3005) cannot override logging.configuration in jboss-cli.sh and jboss-cli.bat

Gabriele Garuglieri (JIRA) issues at jboss.org
Mon Feb 24 10:33:47 EST 2014


Gabriele Garuglieri created WFLY-3005:
-----------------------------------------

             Summary: cannot override logging.configuration in jboss-cli.sh and jboss-cli.bat
                 Key: WFLY-3005
                 URL: https://issues.jboss.org/browse/WFLY-3005
             Project: WildFly
          Issue Type: Enhancement
      Security Level: Public (Everyone can see)
          Components: Scripts
    Affects Versions: 8.0.0.Final
         Environment: windows and linux
            Reporter: Gabriele Garuglieri
            Assignee: Brian Stansberry


when using cli scripts jboss-cli.sh and jboss-cli.bat and you cannot write in $JBOSS_HOME because it is serving many server instances, you can override default jboss-cli.xml setting -Djboss.cli.config in $JAVA_OPTS but you cannot override logging.configuration because in both scripts is set with default after expanding $JAVA_OPTS

last lines of bat script could be modified as follows:
echo "%JAVA_OPTS%" | findstr /I "logging.configuration" > nul
if errorlevel == 1 (
    set "JAVA_OPTS=%JAVA_OPTS% -Dlogging.configuration=file:%JBOSS_HOME%\bin\jboss-cli-logging.properties"
) else (
    echo logging.configuration already set in JAVA_OPTS
)

"%JAVA%" %JAVA_OPTS% ^
    -jar "%JBOSS_RUNJAR%" ^
    -mp "%JBOSS_MODULEPATH%" ^
     org.jboss.as.cli ^
     %*


Last lines of sh script could be modified as follows:
LOG_CONF=`echo $JAVA_OPTS | $GREP "logging.configuration"`
if [ "x$LOG_CONF" = "x" ]; then
    JAVA_OPTS="$JAVA_OPTS -Dlogging.configuration=file:$JBOSS_HOME/bin/jboss-cli-logging.properties"
else
    echo "logging.configuration already set in JAVA_OPTS"
fi

# Sample JPDA settings for remote socket debugging
#JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"

eval \"$JAVA\" $JAVA_OPTS -jar \"$JBOSS_HOME/jboss-modules.jar\" -mp \"${JBOSS_MODULEPATH}\" org.jboss.as.cli '"$@"'


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list