Better to go with DB because if you want to analyze or sort login tries by IP, location ..etc. you can easily do that with MySQL queries but when you go to log you should have an editor and search for something will be really hard.
I personally log the same functionality in my app here is some code how to get browser info and IP.
<?php
function log_login_activity($loginEmail, $loginAuthType = '', $loginAttemptStatus = '', $error = '', $loginRedirect = '',$HeaderInfo = ''){
$loginTime = time();
$browserInfo = getBrowser();
$browser = $browserInfo['name'].' '.$browserInfo['version'];
$loginIP = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "HTTPS" : "HTTP";
$browserAgent = $browserInfo['userAgent'];
DB::insert('?:login_logs',array('email' => $loginEmail, 'time' =>$loginTime, 'browserInfo' =>$browser, 'loginAuthType' =>$loginAuthType, 'IP' =>$loginIP, 'error' => $error, 'protocol' => $protocol, 'loginRedirect' => $loginRedirect, 'browser' => $browserAgent));
}