New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some filenames can be lost in log file selection list #2627
Comments
You are changing the sort order and losing the keys by using sort over arsort if I remember rightly (haven't double checked the functions on php.net) |
--- cacti/lib/clog_webapi.php 2019-04-16 10:46:17.211593816 +0800
+++ cacti/lib/clog_webapi.php 2019-04-16 10:45:23.904577824 +0800
@@ -426,9 +426,14 @@
continue;
}
+ if(strpos($logFile, $stderrLogBase) === 0){
+ $stdErrFileArray[] = $logFile;
+ } else {
$stdLogFileArray[] = $logFile;
}
+ }
+ $stdErrFileArray = array_unique($stdErrFileArray);
$stdLogFileArray = array_unique($stdLogFileArray);
}
@@ -467,7 +472,7 @@
arsort($stdLogFileArray, SORT_NATURAL);
arsort($stdErrFileArray, SORT_NATURAL);
- $logFileArray = $stdFileArray + $stdLogFileArray + $stdErrFileArray;
+ $logFileArray = array_merge($stdFileArray, $stdLogFileArray, $stdErrFileArray);
if (cacti_sizeof($logFileArray)) {
foreach ($logFileArray as $logFile) { |
OK, that seems to make more sense. |
cigamit
added a commit
that referenced
this issue
Apr 17, 2019
Lost partial log files name in Logs(tab)->File(filter selector)
This is resolved now. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
array plus(+) operator will ignore some item with same key, even key is just serial no like 0, 1
So the first two file of $stdLogFileArray is always ignore.
The text was updated successfully, but these errors were encountered: