Writing Physical Activity and Audit log files for Ambience 2025.2 onwards

Note: This configuration is available from Ambience 2025.2 onwards. The following configuration creates both activity and audit log files in the /log directory of the Ambience 2025.2 (and later versions) server installation.

This set of configurations is also used to disable logging to their respective MongoDB collections.

  1. Add the following configuration to etc/application.conf to enable audit logging messages to be appended to the log files and disable audit logging to be written to the MongoDB collection:
    ambience.audit-appender.logger = true
    ambience.audit-appender.database = false

  2. Add the following configuration to etc/application.conf to disable logging messages to MongoDB and be appended to a log file and disable logging to be written to the MongoDB collection:
    ambience.activity-appender {
    database:false
    logger: true
    }

  3. Modify the following in etc/logback.xml to include filters to the ambience log:
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <filter class="ambience.logging.NotAuditFilter"/>
    <filter class="ambience.logging.NotActivityFilter"/>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
    <fileNamePattern>${logFolder}/%d{yyyy-MM-dd}/ambience.log</fileNamePattern>
    </rollingPolicy>
    <prudent>true</prudent>
    <append>true</append>
    <encoder>
    <pattern>${defaultPattern}</pattern>
    </encoder>
    </appender>

  4. Add the following to etc/logback.xml to pipe audit and activity log messages to their respective files:
    <appender name="AUDIT" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <filter class="ambience.logging.AuditFilter"/>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
    <fileNamePattern>${logFolder}/%d{yyyy-MM-dd}/audit.log</fileNamePattern>
    </rollingPolicy>
    <prudent>true</prudent>
    <append>true</append>
    <encoder>
    <pattern>${defaultPattern}</pattern>
    </encoder>
    </appender>

    <appender name="ACTIVITY" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <filter class="ambience.logging.ActivityFilter"/>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
    <fileNamePattern>${logFolder}/%d{yyyy-MM-dd}/activity.log</fileNamePattern>
    </rollingPolicy>
    <prudent>true</prudent>
    <append>true</append>
    <encoder>
    <pattern>${defaultPattern}</pattern>
    </encoder>
    </appender>

  5. Modify the following in etc/logback.xml to include both audit and activity appenders:
    <root level="info">
    <appender-ref ref="STDOUT" />
    <appender-ref ref="FILE" />
    <appender-ref ref="ERROR" />
    <appender-ref ref="AUDIT" />
    <appender-ref ref="ACTIVITY" />
    </root>