We can use Groovy expressions to simplify java object access or method execution. In this article, We need to use Logging inside Groovy scripts.This can be achieved by using the ADF Logger. Just add script similar to this into your Groovy code (e.g inside custom entity validators)
//Create a logger instance for the entity class "Employees in this example"Like In Java, you define a variable to hold the logger reference then use it to print info messages
oracle.adf.share.logging.ADFLogger LOGGER =
oracle.adf.share.logging.ADFLogger.createADFLogger(source.getClass())
LOGGER.info("Groovy Log exemple: oldValue= "+oldValue)
LOGGER.info("Groovy Log exemple: newValue= "+newValue)
LOGGER.info("Groovy Log exemple: Sum of all salaries in a Department
"+Departments1.Employees1.sum('Salary'))
LOGGER.info("Groovy Log exemple: departement remaining budget "+(100000 -
(Departments1.Employees1.sum('Salary')+ newValue) + oldValue ))