mirror of
https://github.com/unraid/webgui.git
synced 2026-05-02 15:59:35 -05:00
Fix container log size
The docker logs command outputs to both stdout and stderr depending upon the type of log entry. Both have to be accounting for in determining the log size
This commit is contained in:
@@ -40,7 +40,7 @@ foreach ($container as $ct) {
|
||||
list($name,$size) = explode('|',$ct);
|
||||
list($writable,$dummy,$total) = explode(' ',str_replace(['(',')'],'',$size));
|
||||
list($value,$base) = explode(' ',gap($total));
|
||||
$list[] = ['name' => $name, 'total' => $value*pow(1000,array_search($base,$unit)), 'writable' => $writable, 'log' => exec("docker logs $name 2>/dev/null|wc -c")];
|
||||
$list[] = ['name' => $name, 'total' => $value*pow(1000,array_search($base,$unit)), 'writable' => $writable, 'log' => exec("docker logs $name 2>&1|wc -c")];
|
||||
}
|
||||
array_multisort(array_column($list,'total'),SORT_DESC,$list); // sort on container size
|
||||
foreach ($list as $ct) echo align($ct['name'],-30).align(autoscale($ct['total'])).align($ct['writable']).align(autoscale($ct['log']))."\n";
|
||||
|
||||
Reference in New Issue
Block a user