Redirect non-logged in users to a specific page

/* add code in current theme activate in this file functions.php */
add_action( 'template_redirect', function() {

if( ( !is_page('login') ) ) {

    if (!is_user_logged_in() ) {
        wp_redirect( site_url( '/login' ) );        // Example : login page             
        exit();
    }

}

});