54 protected function addRow($th, $td =
' ', $escapeTd =
true)
56 $th = htmlspecialchars($th, ENT_NOQUOTES,
'UTF-8');
58 $td =
'<pre>'.htmlspecialchars($td, ENT_NOQUOTES,
'UTF-8').
'</pre>';
61 return "<tr style=\"padding: 4px;text-align: left;\">\n<th style=\"vertical-align: top;background: #ccc;color: #000\" width=\"100\">$th:</th>\n<td style=\"padding: 4px;text-align: left;vertical-align: top;background: #eee;color: #000\">".$td.
"</td>\n</tr>";
73 $title = htmlspecialchars(
$title, ENT_NOQUOTES,
'UTF-8');
75 return '<h1 style="background: '.$this->logLevels[$level].
';color: #ffffff;padding: 5px;" class="monolog-output">'.
$title.
'</h1>';
84 public function format(array $record)
87 $output .=
'<table cellspacing="1" width="100%" class="monolog-output">';
89 $output .= $this->
addRow(
'Message', (
string) $record[
'message']);
92 if ($record[
'context']) {
93 $embeddedTable =
'<table cellspacing="1" width="100%">';
94 foreach ($record[
'context'] as
$key => $value) {
97 $embeddedTable .=
'</table>';
100 if ($record[
'extra']) {
101 $embeddedTable =
'<table cellspacing="1" width="100%">';
102 foreach ($record[
'extra'] as
$key => $value) {
105 $embeddedTable .=
'</table>';
131 return (
string)
$data;
135 if (version_compare(PHP_VERSION,
'5.4.0',
'>=')) {
136 return json_encode(
$data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
139 return str_replace(
'\\/',
'/', json_encode(
$data));
An exception for terminatinating execution or to throw for unit testing.
const EMERGENCY
Urgent alert.
const ERROR
Runtime errors.
const CRITICAL
Critical conditions.
const WARNING
Exceptional occurrences that are not errors.
const INFO
Interesting events.
const DEBUG
Detailed debug information.
const NOTICE
Uncommon events.
const ALERT
Action must be taken immediately.
catch(Exception $e) $message