api/server: extract log init from runserver.