Skip to content

Logging

The Katalogue backend service and repository database emits logs. This section refers to logging configuration for the backend service, please consult the PostgreSQL documentation for configuring the postgres logs.

Katalogue logs both to local files and to console by default.

The following security-related information is logged:

  • All errors are logged.
  • All user authentication actions such as login and access token renewal, are logged (at the info loglevel).
  • All data changes in Katalogue are logged to the public.changelog table along with the username of the user that performed the action.
  • Optionally: All HTTP requests that hit the backend API can be logged to the public.http_request database table. This feature is disabled by default due to performance considerations.

File logs are rotated automatically, but the public.changelog and public.http_request tables must be cleansed manually.

Log files are written to the logs folder inside the backend service directory — services/api/logs in a source installation, /usr/app/logs in the Docker container. The location does not depend on the directory the service was started from.

One file is written per day, named after the service that produced it and the date:

FileWritten by
katalogue_api_<date>.logThe backend API service, including the scheduler and worker when they run embedded
katalogue_worker_<date>.logA separate worker service, when one is deployed

Each service also maintains an audit file next to its logs — katalogue_api_audit.json and katalogue_worker_audit.json — recording the files it has written so that old ones can be deleted. Files older than LOG_MAXFILES (14 days by default) are removed automatically as the log rotates.

The two services keep separate files on purpose: they share the same log folder, and two processes writing one file would interleave their entries and interfere with each other’s rotation.

A few logging options in Katalogue can be configured through the GUI in the Settings -> Logging page:

  • Log level. Only Info or Debug, other levels must be set through environment variables or config file.
  • Enable/disable HTTP Request logging. If enabled, all HTTP requests to the backend service is logged to the public.http_request table. This is primarily intended as a debugging feature as it will have a performance impact (each request results in two extra DB operations). In essence, the HTTP Request log captures the requested resource/endpoint, requestor (ip address and username if available), status and response time.

See the logging category in Config Parameter Reference for all logging-related options.