Date: Fri, 29 Mar 2024 13:25:40 +0000 (UTC) Message-ID: <266707075.5.1711718740790@c3a121c3f801> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_4_104503813.1711718740790" ------=_Part_4_104503813.1711718740790 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The syntax of an explicit logging e= xpression is:
&= lt;expr>.klog(<message>)
where <expr>
is any vali=
d KRL expression. The expression is returned, and something like the follow=
ing is added to the console log (and the "Logging" tab of the UI if enabled=
):
[= KLOG] <message> <expr converted to a string>
The syntax of an explicit logging statement in the postlude is:
l= og <level> <expr>
where <level>
is one of info
, =
warn
, error
, or debug
; and
The following example would place a string with the value of a variable =
named query
in the log if the rule fired:
f= ired { log debug "query:"+query }=20
The following would only log with an empty query:
f= ired { log debug "Empty query" if(query like "^$") }
The following rule is selected when an http:post()
event is=
seen with a status code indicating an error. The error is logged and then =
processing is stopped.
r= ule r3 is active { select when http post label re#ex# status_code re#([45]\d\d)# setting (st= atus) noop(); fired { log error <<Error: #{status}: #{event:attr("status_line")}>>= ; last; } }
Another approach to logging would use explicit error handling.