(Complete description and example)
/**
* LogViewer::all()
*
* @return Arcanedev\LogViewer\Entities\LogCollection
*/return a paginator object for all logs.
/**
* LogViewer::paginate($perPage = 30)
*
* @param int $perPage
*
* @return Arcanedev\LogViewer\Entities\LogCollection
*/(Complete description and example)
/**
* LogViewer::get($date)
*
* @param string $date - Format : YYYY-MM-DD
*
* @return Arcanedev\LogViewer\Entities\Log
*/(Complete description and example)
/**
* LogViewer::entries($date, $level = 'all')
*
* @param string $date - Format : YYYY-MM-DD
* @param string $level
*
* @return Arcanedev\LogViewer\Entities\LogEntryCollection
*/(Complete description and example)
/**
* LogViewer::delete($date)
*
* @param string $date - Format : YYYY-MM-DD
*
* @return bool
*/(Complete description and example)
/**
* LogViewer::download($date, $filename = null, $headers = [])
*
* @param string $date
* @param string|null $filename
* @param array $headers
*
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
*/return list of log files (paths).
/**
* LogViewer::files()
*
* @return array
*/
$files = LogViewer::files();
var_dump($files);
/*
array(
0 => "{BASE_PATH}\storage\logs\laravel-2015-04-01.log"
1 => "{BASE_PATH}\storage\logs\laravel-2015-05-01.log"
2 => "{BASE_PATH}\storage\logs\laravel-2015-06-01.log"
...
)
*/return list of log files (only dates).
/**
* LogViewer::dates()
*
* @return array
*/
$dates = LogViewer::dates();
var_dump($dates);
/*
array(
0 => "2015-06-01"
1 => "2015-05-01"
2 => "2015-04-01"
...
)
*/return the number of log files (0 if the log folder is empty)
/**
* LogViewer::count()
*
* @return int
*/
$count = LogViewer::count();
var_dump($count); // >= 0return total of all logs entries
/**
* LogViewer::total($level)
*
* @param string|null $level - Log level if you want to filter the entries
*
* @return int
*/
$total = LogViewer::total(); // or LogViewer::total('all')
var_dump($total); // >= 0
// To filter by level
$total = LogViewer::total('error');
var_dump($total); // >= 0return all PSR-3 log levels.
/**
* LogViewer::levels()
*
* @return array
*/
$levels = LogViewer::levels();
var_dump($levels);
/*
array(
"EMERGENCY" => "emergency"
"ALERT" => "alert"
"CRITICAL" => "critical"
"ERROR" => "error"
"WARNING" => "warning"
"NOTICE" => "notice"
"INFO" => "info"
"DEBUG" => "debug"
)
*/return all translated log levels.
/**
* LogViewer::levelsNames($locale)
*
* @param string|null $locale
*
* @return array
*/
$levels = LogViewer::levelsNames(); // or LogViewer::levelsNames('auto')
var_dump($levels);
/* If the 'app.locale' == 'en' then the result would be :
array (
"emergency" => "Emergency"
"alert" => "Alert"
"critical" => "Critical"
"error" => "Error"
"warning" => "Warning"
"notice" => "Notice"
"info" => "Info"
"debug" => "Debug"
)
*/If you want to force the translation to a specified language.
/**
* LogViewer::levelsNames($locale)
*
* @param string|null $locale
*
* @return array
*/
$levels = LogViewer::levelsNames('fr');
var_dump($levels);
/*
array(
"emergency" => "Urgence"
"alert" => "Alerte"
"critical" => "Critique"
"error" => "Erreur"
"warning" => "Avertissement"
"notice" => "Notice"
"info" => "Info"
"debug" => "Debug"
)
*/(Complete description and example)
/**
* LogViewer::tree($trans = false)
*
* @param bool|false $trans
*
* @return array
*/(Complete description and example)
/**
* LogViewer::menu($trans = true)
*
* @param bool|true $trans
*
* @return array
*/Get the LogViewer's version.
/**
* LogViewer::version()
*
* @return string
*/
$version = LogViewer::version(); // or log_viewer()->version()
echo $version; // x.x.x(Complete description and example)
(Complete description and example)
(Complete description and example)
(Complete description and example)
(Complete description and example)