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.

TableRoleMain fields
syslogsystem loglevel, channel, message, context, run time, user, company_id (if the column exists)
useruser name for the lineread only
eventevent logcode, message, date_added

Endpoints

  • log.list: filter by level, channel, text, company group and company (IN filter on the member companies' IDs if the company_id column exists); paging (including all); 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 descending date_added order, 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 basic access permission (redirect), the list endpoint 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 to canSee(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.

Related topics: log content scope