This site has been deprecated. Do not edit pages here. Please visit the new Pico Labs documentation.


Skip to end of metadata
Go to start of metadata

The syntax of an explicit logging statement is:

where <expr> is any valid KRL expression that results in a string (or something that can be cast as a string such as a number).

Explicit logging places the log message in two places:

  • The log message is placed in the transaction log that is returned with the evaluation results if the logging pragma is on in the meta section
  • The log message is shown in the browser's console if the ruleset returns JavaScript to a browser (see Web actions). 

The following example would place a string with the value of a variable named query in the log if the rule fired:

The following would only log with an empty query:

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. 

Another approach to logging would use explicit error handling.

See Debugging KRL for more information on debugging tools. 

Labels: