Browse Source

Show stack traces on the message log page

tags/3.1.0
Mike Koch 2 years ago
parent
commit
cc880a15fc

+ 1
- 0
admin/view_message_log.php View File

@@ -97,6 +97,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<th><?php echo $hesklang['user']; ?></th>
<th><?php echo $hesklang['custom_place']; ?></th>
<th><?php echo $hesklang['message']; ?></th>
<th><?php echo $hesklang['stack_trace_header']; ?></th>
</tr>
</thead>
<tbody></tbody>

+ 2
- 1
api/index.php View File

@@ -122,7 +122,8 @@ function getLoggingLocation($exception) {
// http://stackoverflow.com/a/9133897/1509431
$trace = $exception->getTrace();
$lastCall = $trace[0];
return basename($lastCall['file'], '.php');
$location = basename($lastCall['file'], '.php');
return "REST API: {$location}";
}

/**

+ 3
- 0
internal-api/dao/message_log_dao.php View File

@@ -23,12 +23,15 @@ function search_log($hesk_settings, $location, $from_date, $to_date, $severity_i
if ($severity_id != NULL) {
$sql .= "AND `severity` = " . intval($severity_id);
}
$sql .= " ORDER BY `id` DESC";

$rs = hesk_dbQuery($sql);

$results = array();
while ($row = hesk_dbFetchAssoc($rs)) {
$row['timestamp'] = hesk_date($row['timestamp'], true);
$row['stackTrace'] = nl2br($row['stack_trace']);
unset($row['stack_trace']);
$results[] = $row;
}


+ 2
- 1
internal-api/js/view-message-log.js View File

@@ -53,7 +53,8 @@ function displayResults(data) {
'<td>' + result.timestamp + '</td>' +
'<td>' + result.username + '</td>' +
'<td>' + result.location + '</td>' +
'<td>' + result.message + '</td>');
'<td>' + result.message + '</td>' +
'<td>' + result.stackTrace + '</td>');
}
}
}

+ 3
- 0
language/en/text.php View File

@@ -45,6 +45,9 @@ $hesklang['_COLLATE']='utf8_unicode_ci';
// This is the email break line that will be used in email piping
$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
$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';

Loading…
Cancel
Save