APPX Audit Log
Use the audit log to find out who changed an APPX record, which process made the change, and what the old and new values were. You can also record reads, inserts, deletes, file creation, and restructures.
How the pieces fit together
The audit service listens on a TCP port and writes XML on the machine running the service. A Log Profile tells APPX which listener to use and which file operations to record. Assign that profile to an individual file or to its File System Group to start collecting those events. For a file stored in a relational database, the log covers operations made through APPX. Changes made directly in SQL are outside its scope.
Set up the audit service
Use appxAuditMgr from the APPX installation’s services directory. Pick an unused port and an existing directory where the service account can write the XML. Audit records can contain field values, so give read access to the people who need to review them.
The examples use service name appxAudit8070 and port 8070. Substitute your own paths and port. For another listener, choose a different service name, port, and output filename pattern.
Linux
From the installation’s services directory, use an administrator account to install the service. This example assumes the output directory /var/log/appx-audit already exists. Installation starts the listener.
./appxAuditMgr -install -name=appxAudit8070 \
-ServiceType=LogMonitor -SockPort=8070 \
'-LogNamePattern=/var/log/appx-audit/audit-%N.xml'
./appxAuditMgr -status appxAudit8070
Run subsequent manager commands from the same directory so it can find the service configuration. Use the permissions supplied with your APPX installation.
Windows
Open PowerShell as an administrator in the APPX services directory. This example assumes C:\APPX\audit exists and the service account can write to it. Use the spelling LogMonitor shown here.
.\appxAuditMgr.exe -install -name=appxAudit8070 `
-ServiceType=LogMonitor -SockPort=8070 `
'-LogNamePattern=C:\APPX\audit\audit-%N.xml'
.\appxAuditMgr.exe -status
Windows status lists the registered APPX services. Find appxAudit8070, or open Windows Services and check that this instance is running.
Choose which files and events to log
- In System Administration → Configuration → Log Profiles, add a profile and give it a name. In Server, enter the listener’s host and port, for example
auditserver:8070. Use the same port you gaveappxAuditMgr. - Open Log Profile Parameters. For this setup, leave Path blank to use the listener’s filename pattern. Under Events to Log, select the operations you want. For a first test, enable Log Record Rewrites? so you can see which fields changed. Under Content to Log you can choose whether to include null fields and the available descriptive names. Save the profile.
- Assign the profile at the scope you need. For a group, go to Configuration → File System Groups → FMS Group Attributes and set Log Profile on the existing group. For one file, go to Data File Management → File Specifications → File Attributes for that database and file and set Log Profile. A valid file-level profile takes precedence over the group profile.
Start with one test file. Enabling reads on a busy group can produce an event for each read. If two profiles need different event selections within the same session, give them separate listener ports. APPX reuses the logging connection for a given endpoint.
Verify a change from APPX to XML
- Open a fresh APPX session so the test file opens with the saved profile. In a test database, change one known field on an existing record and save it. Note the key and the old and new values.
- On the listener host, locate the XML file matching
LogNamePattern. For a complete document, rotate the file and open the one that just closed. - Find an
eventwitheventID/typeequal toUpdateand the expectedfileID/filename. For an indexed file, match the primary key ineventRecordID/keySegment. UndereventData/field, verify the field name,oldValueandnewValue. ChecksessionID/userIDto identify the APPX user.
Service commands and settings
Use the service name for the instance you want to manage. For Linux examples below, run ./appxAuditMgr. For Windows PowerShell, run .\appxAuditMgr.exe.
-install- Create the service and start the listener. Supply a name,
-ServiceType=LogMonitor, the listening port, and the XML filename pattern. See the Linux and Windows examples. -status- Check the running instance. Linux accepts the service name. On Windows, run
-statusand locate the service in the list. -start / -stop- Start or stop the named service. For example,
./appxAuditMgr -start appxAudit8070on Linux. Stopping the listener interrupts collection. -rotate- On Linux, close the current XML file and open the next one. For Windows, see Rotate and locate logs.
-modify- Change selected settings on an existing service. For example,
./appxAuditMgr -modify -name=appxAudit8070 -LogRotationSize=100M. The manager restarts the service to apply the change. -replace / -remove-replacereinstalls the named service using the settings you supply.-removeremoves the service registration. Save the existing configuration before either operation.-name / -ServiceName- Identify the service instance. Use that name to select the instance when starting, stopping, or rotating it.
-DisplayNamesupplies a descriptive service label. -ServiceType- Use
LogMonitorfor an audit listener. -SockPort / -port- Choose an unused TCP port and enter that port in the APPX Log Profile. Port
8070is the example used here. -LogNamePattern- Set the full path and filename pattern for the audit XML on the listener host. Include
%Nso multiple rotations on the same date use different filenames. -LogRotationInterval- Maximum time, in seconds, before rotation.
86400means one day. -LogRotationSize- Rotate when the next event would take the file over the size limit. For example,
100Mmeans 100 MiB. -LogDirectory- Select the directory for service diagnostics. Use
-LogNamePatternto select the audit XML location. -CreateLogFile- On Windows, set to
trueto enable the service diagnostic log file.
Rotate and locate logs
LogNamePattern names the audit XML. Use a literal %N for a counter so rotations on the same day can produce different names. For a date and a counter together, use a pattern such as audit-%Y-%m-%d-%N.xml. Give each listener its own pattern.
Linux. Rotate just the named listener while it is running. The closed file receives its closing </events> tag and the listener writes subsequent events to the next file.
./appxAuditMgr -rotate appxAudit8070
Windows. For routine rotation use the time or size settings. If a file must be closed immediately, schedule a brief interruption and stop and start the named service.
.\appxAuditMgr.exe -stop appxAudit8070
.\appxAuditMgr.exe -start appxAudit8070
Where to look on the service host
- Audit XML
- The file matching
LogNamePatterncontains the APPX events. An open file can still be missing its closing XML tag. - Linux configuration
- The service’s
.inifile holds its settings. Its.envfile holds environment entries. The setup above needs no extra environment variables. Keep these files in the service configuration directory. - Linux diagnostics
- Look in
LogDirectoryforappxAudit8070.statandappxAudit8070.log. The status file shows the running configuration. The diagnostic log can show startup, listener, and file-opening messages. - Windows configuration and diagnostics
- Service settings are kept in the Windows registry. Use the manager to change the settings and Windows Services to inspect the instance. Set
CreateLogFilewhen you want a diagnostic log file.
Read the XML events
A closed file contains an events root with one event per entry. Match on eventID/type. The screen labels below are from APPX 6.2.1. The XML spelling and capitalization matter for reports.
Read- Log Record Reads? Records the values read. An indexed file also includes its primary key.
Insert- Log Record Write? Records the field values in the newly written record.
Update- Log Record Rewrites? Records changed fields under
eventData/field. Each changed field has anoldValueand anewValue. Delete- Log Record Deletes? Records field values from the record being deleted.
FileCreate- Log Creates? Records the file layout under
structure/field, including the field name, type, occurrence count, raw length, and offset. Restructure- Log Restructures? Records structural changes under
eventData. Examples includerecordSizeChangeanddeletedElement.
Identify the record, user, and process
eventID/timeStamp is in CCYYMMDDhhmmsstt form, ending in hundredths of a second. The service supplies eventID/sequenceNumber. That number can start over after a service restart. For file operations, sessionID/processID is the operating-system process ID and sessionID/userID identifies the APPX user. appxProcessID, when present, identifies the APPX process.
For a multi-occurrence field, occurrence identifies which occurrence changed, starting at 1. Here is the changed-field portion of an example Update event.
<eventData>
<field>
<fieldName>STATUS</fieldName>
<oldValue>OPEN</oldValue>
<newValue>CLOSED</newValue>
</field>
</eventData>
Run the sample reports
Download the stylesheet you need and run it against a closed XML file. structure.xslt lists the fields, types, occurrences, and offsets from FileCreate events. subrs.xslt lists events recorded while the APPX process type was SUBR.
xmllint --noout audit-0.xml
xsltproc --nonet structure.xslt audit-0.xml > file-structures.html
xsltproc --nonet subrs.xslt audit-0.xml > subroutine-events.html
Reporting in a database
For reporting across files, import the closed XML with your database’s XML loader. Store the source filename and each event’s position along with its type, timestamp, user, and file. Keep repeating key segments and changed fields as child rows. This preserves both parts of a composite key and all the fields changed in one rewrite.
Troubleshoot missing events
- The listener is running, but the test is missing
- Match the profile’s Server host and port to the running service. Check the profile on the test file and on its group, enable the operation you actually performed, then reopen the file in a fresh session. A record edit needs Log Record Rewrites?
- I found a log, but it contains startup messages
- That is the service diagnostic log. Open the XML on the listener host at the location set by
LogNamePattern. Check the output directory and the service account’s write access if the XML is missing. - The XML reader reports an unexpected end
- Check whether the listener still has that file open. Rotate normally and parse the completed file. If a closed file still fails validation, keep it for diagnosis.
- The report has a header but no data
- The structure report needs a
FileCreateevent. The subroutine report needsappxProcessID/typeequal toSUBR. Look at the XML to see whether the selected file contains a matching event.

