Catch empty deprecation.log silently (fixes #31050)
This commit is contained in:
parent
5f4c27f0de
commit
291c73a290
@ -126,9 +126,13 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('' === $logContent = trim(file_get_contents($file))) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
$bootTime = filemtime($file);
|
$bootTime = filemtime($file);
|
||||||
$logs = [];
|
$logs = [];
|
||||||
foreach (unserialize(file_get_contents($file)) as $log) {
|
foreach (unserialize($logContent) as $log) {
|
||||||
$log['context'] = ['exception' => new SilencedErrorContext($log['type'], $log['file'], $log['line'], $log['trace'], $log['count'])];
|
$log['context'] = ['exception' => new SilencedErrorContext($log['type'], $log['file'], $log['line'], $log['trace'], $log['count'])];
|
||||||
$log['timestamp'] = $bootTime;
|
$log['timestamp'] = $bootTime;
|
||||||
$log['priority'] = 100;
|
$log['priority'] = 100;
|
||||||
|
Reference in New Issue
Block a user