Trace
Last updated
Last updated
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.
Argument | Type | Required | Description | Default |
---|---|---|---|---|
text
string
true
The text of the trace message. Required.
category
String
false
The category of the trace message. Default is an empty string.
type
string
false
The type of the trace message. Default is "Information".
Information
extrainfo
any
false
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.
abort
boolean
false
If true, the current request will be aborted after the trace call. Default is false.
false