Qlik Logging Service

The Qlik Logging Service is used to centralize logging, which makes it easier for you to find the log that you are looking for.

When centralized logging (the Qlik Logging Service) is on, file logging is also on, by default. Log entries from the Qlik Sense services (repository, proxy, scheduler, and engine) are persisted in two locations – the existing log files and the centralized logging database. The legacy log files do not have any built-in file management to clear up hard disk space.

Although the Qlik Logging Service will be installed as a Windows service, you can use it directly as a command line tool to configure or change the database settings. The available commands are included in this topic.

Nota: Currently, there is no support for streaming messages from the Qlik Logging Service to third-party tools or customers. The only supported way is through the Monitoring apps. See Log Monitor.

Command line options

These are the available commands for the Qlik Logging Service.

Usage: Qlik.Logging.Service.exe <action> [<args>]

The following commands can be used to set up, update, or validate the logging database:

setup - creates the logging database and sets up roles and access permissions.

update - updates the connection string parameters for the logging database with user-provided values.

validate - validates connection string parameters from the configuration file and database connectivity.

archive - moves database entries to the archive table.

purge - removes (permanently) database entries from the archive table.

version - displays version information for the service.

help - displays help message.

Setting up the logging database

The setup command is typically used by the installer at the time of the Qlik Sense installation. The setup command creates the logging database and sets up access roles and required permissions.

Usage: Qlik.Logging.Service.exe setup [<options>]

Options

--hostname or -h (Required)

Name of the machine where the logging database is hosted.

--port or -p (Required)

Port number used to access the logging database.

--postgres_user or -u (Required)

PostgreSQL user name credentials required to create the logging database.

--postgres_pswd or -x (Required)

PostgreSQL password required to create the logging database.

--reader_pswd or -r (Required)

Password for qlogs_reader user role, used for reading logging database entries.

--writer_pswd or -w (Required)

Password for qlogs_writer user role, used for writing to the logging database.

--force or -f (Optional)

Drop the existing database and users, if present.

Updating the connection string parameters

The update command is used to modify the connection, the configuration settings of the logging database, or both.

Usage: Qlik.Logging.Service.exe update [<options>]

Options

--hostname or -h (Optional)

Name of the machine where the logging database is hosted.

--port or -p (Optional)

Port number used to access the logging database.

--reader_pswd or -r (Optional)

Password for qlogs_reader user role, used for reading logging database entries.

--writer_pswd or -w (Optional)

Password for qlogs_writer user role, used for writing to the logging database.

--archive_age or -a (Optional)

Sets value for archive age. The value is specified in days. Specify --hours to interpret archive age as hours, for example, --archive_age X --hours.

--purge_age or -q (Optional)

Sets value for purge age. The value is specified in days. Specify --hours to interpret purge age as hours, for example, --purge_age X --hours.

--file_logging or -f (Optional)

Switches on or off file logging. Valid values are 'on' or 'off'.

--database_logging or -d (Optional)

Switches on or off database logging. Valid values are 'on' or 'off'.

--maximum_db_size_in_gb or -s (Optional)

Sets value for maximum database size. The value is specified in GB. A value less than two (2) disables the functionality that limits the database size.

Validating the logging database connection

Usage: Qlik.Logging.Service.exe validate [<options>]

Options

None. The connection string is read from the logging configuration and is used to validate the state of the database and the connection.

Archiving the log entries

Archives all the log entries that are older than the specified cutoff time (in days).

Usage: Qlik.Logging.Service.exe archive [<options>]

Options

--cutoff or -c (Required)

--hours (Optional)

Cutoff time in days. Specify --hours option to interpret cutoff time as hours, for example, archive --cutoff X --hours. Specify zero (0) to archive all the entries.

Purging log entries

Purges all the archived log entries that are older than the specified cutoff time (in days).

Aviso: Purge is an irreversible operation. Log entries are removed from the database and cannot be restored. This operation does not affect log messages in the log files.

Usage: Qlik.Logging.Service.exe purge [<options>]

Options

--cutoff or -c (Required)

--hours (Optional)

Cutoff time in days. Specify --hours option to interpret cutoff time as hours, for example, purge --cutoff X --hours. Specify zero (0) to purge all the entries.

Version

Usage: Qlik.Logging.Service.exe version [<options>]

Options

None. Displays Qlik Logging Service and logging database versions.

Help

Usage: Qlik.Logging.Service.exe help [<options>]

Options

None. Displays usage.