Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Inconsistent logging behavior

I'm using jetty (9.4.4) purely as a servlet container and have logging configured to use log4j. I configure logging as such:

jetty@foo:/opt/jetty-base/modules$ curl -O https://raw.githubusercontent.com/jetty-project/logging-modules/master/log4j-1.2/logging.mod

jetty@foo:/opt/jetty-base/modules$ cd ..

jetty@foo:/opt/jetty-base$ java -jar /opt/jetty/start.jar --add-to-start=logging

then I copy the log4j properties file below to

/opt/jetty-base/resources/


log4j.properties:


log4j.rootLogger=out


log4j.appender.out=org.apache.log4j.RollingFileAppender

log4j.appender.out.layout=org.apache.log4j.PatternLayout

log4j.appender.out.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n

log4j.appender.out.file=/opt/jetty-base/logs/jetty.log

log4j.appender.out.append=true

log4j.appender.out.maxFileSize=10MB

log4j.appender.out.maxBackupIndex=30

It works pretty well, but periodically I notice that, when I have multiple wars deployed, logging from one or the other disappears. After I restart jetty, everything is logged again for a while.

I am looking for guidance on how to configure jetty's logging to be bullet-proof and ideally, I'd like to have one log file per webapp.

Thanks in advance.

Back to the top