Trace
Traces messages into the tracing facilites so they can be display by the running runtime either in console, or debug output or whatever the runtime is configured to do.
It will track from where the trace call was made and the message will be logged with the category, type and text provided.
All tracers will be sent to the {@code trace.log} file in the logs directory of the runtime as well.
If the {@code abort} attribute is set to true, the current request will be aborted after the trace call.
Tracers will only be displayed if the runtime is in debug mode. . However, all traces will be logged regardless of the debug mode flag.
The {@code extraInfo} attribute is optional and can be any simple or complex object. We will convert it to string for logging using the {@code toString()} method on the object. You can also use the alias of {@code var} for this attribute as well.
Method Signature
Arguments
Argument | Type | Required | Description | Default |
---|---|---|---|---|
|
|
| The text of the trace message. Required. | |
|
|
| The category of the trace message. Default is an empty string. | |
|
|
| The type of the trace message. Default is "Information". |
|
|
|
| Any extra information to be logged with the trace message. This can be simple or a complex object. We will convert it to string for logging. | |
|
|
| If true, the current request will be aborted after the trace call. Default is false. |
|
Examples
Related
Last updated