System log and event log: writing, querying, permissions
The writer and switch of the central system log, list filtering and the run-time series, deletion and filtered clearing, and the permission gaps of the event log.
The lines of the central system log are written by the logging service library (levels debug, info, warning, error; channel, context, microsecond timing with start and stop). Logging is switched with the syslog_enabled module setting. The screen is a read-only list with deletion.
Data model
Table names carry the installation's own prefix in the database.
| Table | Role | Main fields |
|---|---|---|
syslog | system log | level, channel, message, context, run time, user, company_id (if the column exists) |
user | user name for the line | read only |
event | event log | code, message, date_added |
Endpoints
log.list: filter by level, channel, text, company group and company (IN filter on the member companies' IDs if thecompany_idcolumn exists); paging (includingall); user name map.log.durations: run-time series per channel for a date range (default: last 7 days), starting with the slowest channel.log.companiesByGroup: company picker.log.delete: physical delete of the selected lines.log.clear: deletes all lines matching level, channel and text; ignores the company filter; reports the count.log/event.list: list in descendingdate_addedorder, 20 per page.
Permissions
system/log:list(unclassified),delete,clear,debug(not in the seeds).- No content scope by default: without a company filter every log line is shown.
log/event: the page only checks the basicaccesspermission (redirect), thelistendpoint checks no permission at all, there is no function permission check; in the feature catalogue it is an unclassified row and it is missing from the permission catalogue. The menu item is shown according tocanSee(log/event, list).
Known limitations
The system log shows lines of every company without content scope; the event log list endpoint can be called without any permission check.