How do I control Sonatype Nexus access logging in Jetty?

For Nexus 2.11.4 the request log defaults are even more useful. Improvements have been added, such as:

  • in certain cases, the authenticated user making the request was not logged in nexus.log - this has been fixed
  • elapsed time is now recorded as the last field of the log pattern format - this can help identify particularly slow requests
  • the request.log is archived with a more compatible name: request-YYYY-MM-DD.log.gz, instead of request.log.YYYY-MM-DD.gz

For Nexus 2.8.1, we fixed a bug that corrects where the rotated access logs end up.

For Nexus 2.8+, access logging is enabled by default and has a number of improvements.

  • logging uses a performant and flexible LogBack implementation with built-in log rotation already configured for 90 days of log file retention
  • can be easily customized to print any variety of request values
  • can be disabled entirely by commenting out a single line line in bin/jsw/conf/wrapper.conf
  • if required, customize the log rotation settings by editing NEXUS_HOME/conf/logback-access.xml and restart Nexus

For Nexus 2.7, replace the contents of jetty.xml with the contents of the Nexus bundled examples/jetty-access-log.xml after verifying any differences with your own customizations.

For Nexus 2.2 to 2.6, replace the contents of "<nexus_root>/conf/jetty.xml" with this jetty-access-log.xml file, then restart the server.  The access log will show up in sonatype-work/nexus/logs.

For Nexus 2.1 use jetty-access-log-2.1.xml .

For Nexus 2.0 use jetty-access-log-2.0.xml

For options to monitor the user making requests in to Nexus, see this article.

Have more questions? Submit a request


  • 0
    gabe friedmann

    I run 2.7.1 and set this up, but the jetty access log is not including the HTTP user name if provided. I'm not sure how to fix this yet. The username field is useful to help us audit our migration away from anonymous access. 

  • 0
    Peter Lynch

    We are closing this article for comments.

    If you have a support license, please contact us by submitting a support ticket.

    If you do not have a support license, please use our Nexus Users List or our other free support resources.

Article is closed for comments.