added an exit error code for main commands, and log for the server