By file transfer mode, I mean TFTP/SFTP/SCP. But it shouldn't matter if you're doing a CLI script.
That said, you should just be able to deploy a config template containing "logging x.x.x.x". You don't have to do it as a CLI script. Give that a go, see what happens.
Also, out of interest, what happens if you do set a username & password on the device? I'm wondering if something somewhere is making an assumption that you do have a username/password. From memory, most of the code should handle it, but there is usually an assumption of basic authentication.