log
log copied to clipboard
Add get log destination Add check log empty
I've added code to check if the log is empty and where the log file is. Here's how I use it:
foreach ($container['logger']->getBuckets() as $bucket) {
// check not empty and at least warning (4)
if (get_class($bucket) === 'Apix\\Log\\Logger\\File' && !$bucket->isEmpty()) {
if (!$file = $bucket->getDestination()) {
continue;
}
// get log content
$content = file_get_contents($file, false);
// send log by email
}