Logging and login rewrite.