Hi guys, a noob question here, so I was reading the documentation about logging and saw this example:
import org.slf4j.Logger; import org.slf4j.LoggerFactory; Logger logger = LoggerFactory.getLogger("org.bonitasoft.groovy.script.my_int_init_script"); logger.debug("Set initial value of process variable using Groovy script"); return Integer.valueOf(3 + 5);
Tried it in a simple process but I have no idea where exactly does it print the log, because that´s what is suppose to do right? I already imported the slf4j jar and checked the engine and studio log but I can´t find it.
//init vars
string routineName = “my Groovy Script Name”;
int dI = 0;
boolean debug = true; // make false when not debugging
//get the process name
ProcessRuntimeAPI processRuntimeAPI = apiAccessor.getProcessAPI();
String processName = processRuntimeAPI.getProcessInstance(processInstanceId).getName();
//set the name of the routine
String thisTrace = " “+processName+” " + routineName+": ";
//print out the returned data last before the return
if(debug){dI++; logger.severe(dI+thisTrace+"return Data: "+returnData.toString());}
if(debug){dI++; logger.severe(dI+thisTrace+“Trace End”);}
return returnData;
This will go into the Bonita BPM Engine Log and you can search by process name or my Groovy Script Name.
regards
Seán
PS: If this solves your problem, please mark as Resolved
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.