it may be sending the log command to the finder which does not know what to do with it.
try wrapping it in
tell application "Script Editor" (or whatever app you are using)
like:
tell application "Finder"
tell application "Script Editor"
log "blah"
end