Show stack traces on the message log page
This commit is contained in:
parent
f15cb63d32
commit
cc880a15fc
@ -97,6 +97,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
<th><?php echo $hesklang['user']; ?></th>
|
<th><?php echo $hesklang['user']; ?></th>
|
||||||
<th><?php echo $hesklang['custom_place']; ?></th>
|
<th><?php echo $hesklang['custom_place']; ?></th>
|
||||||
<th><?php echo $hesklang['message']; ?></th>
|
<th><?php echo $hesklang['message']; ?></th>
|
||||||
|
<th><?php echo $hesklang['stack_trace_header']; ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody></tbody>
|
<tbody></tbody>
|
||||||
|
|||||||
@ -122,7 +122,8 @@ function getLoggingLocation($exception) {
|
|||||||
// http://stackoverflow.com/a/9133897/1509431
|
// http://stackoverflow.com/a/9133897/1509431
|
||||||
$trace = $exception->getTrace();
|
$trace = $exception->getTrace();
|
||||||
$lastCall = $trace[0];
|
$lastCall = $trace[0];
|
||||||
return basename($lastCall['file'], '.php');
|
$location = basename($lastCall['file'], '.php');
|
||||||
|
return "REST API: {$location}";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -23,12 +23,15 @@ function search_log($hesk_settings, $location, $from_date, $to_date, $severity_i
|
|||||||
if ($severity_id != NULL) {
|
if ($severity_id != NULL) {
|
||||||
$sql .= "AND `severity` = " . intval($severity_id);
|
$sql .= "AND `severity` = " . intval($severity_id);
|
||||||
}
|
}
|
||||||
|
$sql .= " ORDER BY `id` DESC";
|
||||||
|
|
||||||
$rs = hesk_dbQuery($sql);
|
$rs = hesk_dbQuery($sql);
|
||||||
|
|
||||||
$results = array();
|
$results = array();
|
||||||
while ($row = hesk_dbFetchAssoc($rs)) {
|
while ($row = hesk_dbFetchAssoc($rs)) {
|
||||||
$row['timestamp'] = hesk_date($row['timestamp'], true);
|
$row['timestamp'] = hesk_date($row['timestamp'], true);
|
||||||
|
$row['stackTrace'] = nl2br($row['stack_trace']);
|
||||||
|
unset($row['stack_trace']);
|
||||||
$results[] = $row;
|
$results[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,8 @@ function displayResults(data) {
|
|||||||
'<td>' + result.timestamp + '</td>' +
|
'<td>' + result.timestamp + '</td>' +
|
||||||
'<td>' + result.username + '</td>' +
|
'<td>' + result.username + '</td>' +
|
||||||
'<td>' + result.location + '</td>' +
|
'<td>' + result.location + '</td>' +
|
||||||
'<td>' + result.message + '</td>');
|
'<td>' + result.message + '</td>' +
|
||||||
|
'<td>' + result.stackTrace + '</td>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,9 @@ $hesklang['_COLLATE']='utf8_unicode_ci';
|
|||||||
// This is the email break line that will be used in email piping
|
// This is the email break line that will be used in email piping
|
||||||
$hesklang['EMAIL_HR']='------ Reply above this line ------';
|
$hesklang['EMAIL_HR']='------ Reply above this line ------';
|
||||||
|
|
||||||
|
// ADDED OR MODIFIED IN Mods for HESK 3.1.0
|
||||||
|
$hesklang['stack_trace_header'] = 'Stack Trace';
|
||||||
|
|
||||||
// ADDED OR MODIFIED IN Mods for HESK 3.0.0
|
// ADDED OR MODIFIED IN Mods for HESK 3.0.0
|
||||||
$hesklang['you_have_x_messages'] = 'You have %s new %s'; // %s: Number of new messages, "message" or "messages", depending on #
|
$hesklang['you_have_x_messages'] = 'You have %s new %s'; // %s: Number of new messages, "message" or "messages", depending on #
|
||||||
$hesklang['message_lower_case'] = 'message';
|
$hesklang['message_lower_case'] = 'message';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user