How can I change the number of days of Nexus 3 audit logs retained?

You can configure the number of days worth of audit logs that are retained.

Under $install/etc/logback/logback.xml you can change the maxHistory value from its default 90 to a larger value for the auditlogfile appender. The entry will look like this:

  <appender name="auditlogfile" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <File>${karaf.data}/log/audit/audit.log</File>
    <Append>true</Append>
    <encoder>
      <pattern>%msg%n</pattern>
    </encoder>
    <filter class="org.sonatype.nexus.pax.logging.AuditLogFilter"/>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>${karaf.data}/log/audit/audit-%d{yyyy-MM-dd}.log.gz</fileNamePattern>
      <maxHistory>90</maxHistory>
    </rollingPolicy>
  </appender>


You will need to restart Nexus for this change to be picked up.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.