Solved! Go to Solution.
If you do console.log that should print to the system.log file. Alternately, you can prepare the logging payload in the JavaScript using a flow variable and then use that flow variable in a message logging policy following the JavaScript policy. You cannot call the msg logging policy from within the JavaScript policy.
You can also write your custom logger in the JavaScript policy, to do all this in the policy.