ScriptRunner for Confluence gives you several options for logging script executions:
Check out each type to learn about enabling and disabling logging, advanced options, and where to view your logs.