| width='120' | '''Signature'''
|<pre>admin:write-log(
$text message as xs:string, $type as xs:string := ()
) as empty-sequence()</pre>
|- valign="top"
| '''Summary'''
|Writes a string log {{Code|$message}} to the database logs, along with current user data (timestamp, username). An optional log {{Code|$type}} can be specified. If omitted, the log type is {{Code|INFO}}.<br/>If the function is called from a database client, the IP will be logged. Otherwise, the string {{Code|SERVER}} will be logged.
|- valign="top"
| '''Errors'''