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/log
filesystem without modifying thelogback.xml
file included in the application tarball.To do this:
- I have set
/var/opt/sonatype-work
as the$data-dir
set through${keraf.data}
insidenexus.vmoptions
- I have created
/var/opt/sonatype-work/nexus3/etc/logback/logback.xml
as a copy oflogback.xml
with 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.xml
exists in the correct location - Removed all unchanged sections from
logback-overrides.xml
compared 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.xml
added tonexus.vmoptions
, but received aNullPointerException
indicating thatNullPointerException: Name is not defined
Am I currently missing something?
- I have set
-
Is the file
$install-dir/etc/logback/logback-access.xml
used 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!