It Basically depends on the requirement or the functionality you want to achieve.
1.You can use Java class in bundle if you are implementing the complex logic with various API 's like workflow,node , wcm and others, as we are more familiar in using API's in java class.Will be used normally in Process steps
2. You can use ECMA script if you are doing small logic -like checking the metadata variables of the workitem to perform the appropriate action, like in "OR Step"to determine the flow based on the boolean value passed in ECMA script
You can check ECMA logs in the error log, similar to other logs in AEM