Logging API: fix array to string conversion notice

log_event() used $p_msg to print the message, instead of the sanitized
$s_msg variable, so when logging DB events which are submitted as an
array with execution time, the notice gets triggered.

Regression introduced by 2d0df25ec0fc7d9a0d97c8e5e102b617e5ff96d9

Fixes #17441