Meaning of log4j.properties in EOL Jetty Hightide 7?

24 Views Asked by At

Our product is using Jetty to deploy a webapp in which we are triggering the jetty using the ant build target like below

 <exec executable="**/jetty.sh" failonerror="true">
        <env key="JETTY_CONF" value="***/jetty.conf"/>
        <env key="JETTY_LOGS" value="${logs}"/>
        <env key="JETTY_PID" value="${logs}/jetty.pid"/>
        <env key="TMPDIR" value="${tmp.dir}"/>
        <!-- location where jetty will extract the war -->
        <env key="JAVA_OPTIONS"
             value="-server -d64 ${heapOptions} ${gcOptions} ${sslOptions} ${debugFlags} -Dsettings.path=${settings.path} -Dlog4j.configuration=file:///${xmlFile} -Djetty.secure.port=${*} -Dapp.dir=${*} -Drs.data.dir=${*} -Disutest=${isutest} -Disftest=${ftest} -Disrtest=${rtest} -Disrtestlocal=${rtestlocal} -Dlogs.dir=${logs.dir} -Ddist.dir=${*()} "/>
        <env key="JAVA" value="${JAVA_HOME}/bin/java"/>
        <arg value="${com}"/>
</exec>

In this I am wondering if the -Dlog4j.configuration=file:///${xmlFile} is it for the Jetty to configure the logs or is it webapp specific .

If it is for jetty to configure log4j I do not see any log4j related libraries in jetty. So, need a little clarification on this.

1

There are 1 best solutions below

2
Joakim Erdfelt On

from Jetty 1.0 thru 9.0 Jetty used an in-house Logging Facade, that wrote to STDERR (System.err), with an optional configuration to use slf4j (since Jetty 6.0).

From Jetty 10.0 on-wards Jetty uses the slf4j logging facade (and has it's own jetty-slf4j-impl that writes to STDERR/System.err).

Not once has Jetty depended on or shipped with log4j.

If you see log4j in your configuration, it's something that you (or your predecessors) have added on top of Jetty.