session_log_users for MariaDB Xpand

Overview

When using the Xpand Storage Engine topology, the details described here only apply when you connect to the Xpand nodes.

User Logging

Xpand can track simple user activity on your cluster. User logging consists of timestamped logins and logouts and does not include detailed query activity.

By default, this log data is stored in user.log in the /data/clustrix/log/ directory.

Each Xpand Node will record access information each time a user logs in or out. There is a log file on each node and you can use the logdump command of The clx command-line administration tool to consolidate these logs and perform analysis.

Enabling User Logging

User logging is controlled by the global variable session_log_users and is disabled by default. This variable is not available by session.

Name

Description

Default Value

session_log_users

Log users and LOGIN & LOGOUT to user.log.

FALSE

To activate user logging, run the following SQL statement:

SET GLOBAL session_log_users = TRUE;

Format of the user.log

Here is an example of a user.log entry:

2016-10-06 20:56:41.292686 UTC fcs022.colo.sproutsys.com clxnode:
USER SID:1857340417 db=#undef user=root@localhost LOGIN

This is a list of the data found within the user.log.

Field

Description

Timestamp

Date and time of the log entry. Includes the time zone.

hostname

Name of the host accessed by the user.

process name

The Xpand process name (clxnode).

USER

This identifier precedes user-specific information.

SID

Session ID.

db

Name of the database specified when the user logged in.

user

Username.

activity performed

LOGIN or LOGOUT.