log($message)
log($message, $arguments)
Writes an entry to the application log.
| Name | Type | Description | Mandatory | Default |
|---|---|---|---|---|
| message | String | The message to be written to the log. If arguments is also specified, placeholders in the form of {0}...{n} can be defined in the message. If the message contains a placeholder but there is no argument to fill it, {n} is written to the message in plain text. |
yes | |
| arguments | Set | Arguments to be inserted into the placeholders of message in the specified order. If no or too few placeholders are specified, then not all arguments will be used. |
no |
log('Hello');
Output (in log): Hello
log('Current date: {0}. Current week day: {1}', today(), today().toUserCalendar().dayOfWeek())
Output (in log): Current date: 14.02.22 16:00. Current week day: 2
log('Current date: {0}. Current week day: {1}')
Output (in log): Current date: {0}. Current week day: {1}.
Since no arguments were specified, the placeholders are not replaced and output like this.
log('Current date: {0}', today(), today().toUserCalendar().dayOfWeek())
Output (in log): Current date: 14.02.22 16:00
There are more arguments than placeholders, so the second argument is ignored.