Hello to all,
I am configuring logback for Nexus version 3.80.0-06 and have a few questions:
-
I am using logback-overrides.xml located at
/var/opt/sonatype-work/nexus3/etc/logback/logback-overrides.xml, as described in the official documentation (Logging Configuration).
I want to move all log files to the/logfilesystem without modifying thelogback.xmlfile included in the application tarball.To do this:
- I have set
/var/opt/sonatype-workas the$data-dirset through${keraf.data}insidenexus.vmoptions - I have created
/var/opt/sonatype-work/nexus3/etc/logback/logback.xmlas a copy oflogback.xmlwith updated paths, and then restarted Nexus. However, the override file was completely ignored, and logs are still being written to/var/opt/sonatype-work/nexus3/log/.
I have already:
- Verified that no errors are raised for logback in nexus.log (A line reports this detail:
INFO [jetty-main-1] *SYSTEM org.sonatype.nexus.internal.log.overrides.file.LogbackLoggerOverrides - File: /var/opt/sonatype-work/nexus3/etc/logback/logback-overrides.xml) - Verified that
logback-overrides.xmlexists in the correct location - Removed all unchanged sections from
logback-overrides.xmlcompared tologback.xml(I have left only the configuration and appender blocks) - Tried running Nexus with the option
-Dlogback.configurationFile=/var/opt/sonatype-work/nexus3/etc/logback/logback-overrides.xmladded tonexus.vmoptions, but received aNullPointerExceptionindicating thatNullPointerException: Name is not defined
Am I currently missing something?
- I have set
-
Is the file
$install-dir/etc/logback/logback-access.xmlused by Nexus? It is shipped with the tarball, but not documented, and modifying it does not seem to have any effect. -
In logback.xml, there is a line referencing another XML file that is not documented:
<include file="${karaf.data}/etc/logback/logback-tasklogfile-appender-override.xml" optional="true"/>What is the purpose of this file?
Thank you in advance for your help!