I have to display login link for that user with redirection by page

<?php if (!is_user_logged_in()) : ?>
        <a href="<?php wp_login_url(get_option('siteurl')); ?> "> login</a>     

However this creates the following

<a href=" "> login</a>  

Things i am doing wrong?

You have to echo it

<a href="<?php echo wp_login_url(get_option('siteurl')); ?> "> login</a>