My footer menu is a widget, therefore I had difficulties using the code by Chittaranjan. The following edited version works for me. I also changed the links and made them "dynamic": login leads to a page of your choice, logout will either stay on the current page, or send to home, if the current page is your (private) login page. Ideally it would check if your login page is actually private, but I don't know how to do that, sorry.
add_filter( 'wp_nav_menu_items', 'wti_loginout_menu_link', 10, 2 );
function wti_loginout_menu_link( $items, $args ) {
//var_dump($args);
if (($args->menu->slug == 'footer')) {
if (is_user_logged_in()) {
$loginlink = '/your-private-page';
$logoutlink = get_permalink();
if (strpos($logoutlink, $loginlink) !== false) {
$logoutlink = '/';
}
$items .= '<li class="right"><a href="'. wp_logout_url($logoutlink) .'">'. __("Log Out") .'</a></li>';
} else {
$items .= '<li class="right"><a href="'. wp_login_url($loginlink) .'">'. __("Log In") .'</a></li>';
}
}
return $items;
}
wp_loginout()
?