I want to create a script that parses or makes sense of apache\'s error log to see what the most recent error was. I was wondering if anyone out there has something that doe
adm group has access of to view logs in linux system to access the log from apache we have to add www-data user to adm group and restart the apache so all the changes will update
$ sudo usermod -G adm www-data
$ sudo service apache2 restart
Date
Type
Client
Message
handleError()
/home/gsmcms/public_html/central/cake/libs/debugger.php:0
preg_match('~^\[(.*?)\]~', $line, $date);
if(empty($date[1])) {
continue;
}
preg_match('~\] \[([a-z:]*?)\] \[~', $line, $type);
preg_match('~\] \[client ([0-9\.:]*)\]~', $line, $client);
preg_match('~\] (.*)$~', $line, $message);
?>
=$date[1]?>
=$type[1]?>
=$client[1]?>
=$message[1]?>
}
?>
- 热议问题