I just added these lines to
<PROJECT_NAME>/src/main/amp/config/alfresco/module/<project-name>/log4j.properties
Of course, the <packagename-of-java-file> should be replaced by the actual package name of your
java file
log4j.logger.org.alfresco.repo.jscript=DEBUG
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=DEBUG
log4j.logger.<packagename-of-java-file>=DEBUG
I hope this helps.