Testing Dynamic Logic Using Logs
Here are the steps to test dynamic logic using logs:
Prerequisites
You must have the log back configuration for log appenders. Refer to Logging to a Central Database for more information.
Step 1: Add Logger
POST {apiurl}/generic/loggers { "logger": "ohi.dynamiclogic", "logLevel": "DEBUG", "duration": "600" }
The duration of the log to remain active is in minutes. |
Step 2: Add Debug Statements
In this step, you add the debug statements to your dynamic logic. For example:
log.debug("start") name = newPerson.firstName log.debug("name: ${name}") log.debug("stop")
When adding variables in a debug statement, use a dollar sign ($) and place the variable between curly braces. It is mandatory to use both dollar sign and curly braces as using either leads to undesirable results. |