Hi,
Yes, all of the scripting languages can call Java class methods and they will be able to log in the the same way as the java classes.
I just ran this standalone script:
var LoggerManager = Java.type("org.apache.logging.log4j.LogManager")
var log = LoggerManager.getLogger("script")
log.info("Example info message")
And got this in the zap.log file:
419421 [ZAP-ScriptExecutor-log] DEBUG org.zaproxy.zap.extension.script.ExtensionScript - invokeScript log
419429 [ZAP-ScriptExecutor-log] INFO script - Example info message
Cheers,
Simon