You can do this using these queries:
SET GLOBAL general_log_file='mariadb.log';
SET GLOBAL general_log_file='/var/log/mariadb/query.log';
SHOW VARIABLES LIKE '%general_log_file%';
SET GLOBAL general_log=1;
And then access your logs like this:
tail -f /var/log/mariadb/query.log
Resources: