How to override logback config in Nexus 3?

@david,
Unfortunately, only certain files in /nexus-data/etc override the default config files. At this time, the best way to customize the logging is to change logback.xml directly.

Guessing that you’re running with the docker image, you have 2 options:

  1. (recommended) create your own logback.xml, store in your source code repo, and build your own docker image based from Sonatype’s official image
  2. Create a volume mount for /opt/sonatype/nexus/etc/logback and customize the logback.xml on your host machine.

For those not running Nexus 3.x with Docker, the logback files are stored in $INSTALL_DIR/nexus-3.15.0-01/etc/logback. NOTE: when upgrading, you will need to manually copy the changes forward to the new version folder.

As noted on Rolling policy for nexus.log not working, Nexus 2 worked a bit differently. The logback files were stored in the sonatype-work folder. It would be more convenient if the same were true in Nexus 3. I have created an improvement ticket to track the request: https://issues.sonatype.org/browse/NEXUS-19037

1 Like