0

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.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
vamsi
  • 1,219
  • 1
  • 9
  • 15

1 Answers1

0

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.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • Hi @Joakim Erdfelt, I am confused with the option that is given in the ***-Dlog4j.configuration=file:///${xmlFile} ** and wanted to know if it will override jetty log4j.properties as we are using jetty 7 high tide I can see log4j.properties in ***/resources/log4j.properties*** or wht is the use of that property in the first place . please help me understand this..thanks. – vamsi Feb 21 '22 at 11:41
  • Jetty 7 was EOL (End of Life) back in 2014 as is not meant to be used in production anymore. If you see a `log4j.properties` then something is expecting it, which is not part of Jetty. check your `webapps/*.war` files for log4j, I bet something there is using it. – Joakim Erdfelt Feb 21 '22 at 12:20