本文整理汇总了PHP中Illuminate\Log\Writer::useDailyFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Writer::useDailyFiles方法的具体用法?PHP Writer::useDailyFiles怎么用?PHP Writer::useDailyFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Log\Writer
的用法示例。
在下文中一共展示了Writer::useDailyFiles方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: useDailyFiles
public function useDailyFiles($path, $days = 0, $level = 'debug')
{
if (Config::get('app.sae')) {
return $this->useSaeLog($level);
}
parent::useDailyFiles($path, $days, $level);
}
示例2: configureSeparateWriter
/**
* Configures log writer for logging to files separately from the application.
*
* @param Writer $writer
*/
protected function configureSeparateWriter(Writer $writer)
{
$path = 'logs/' . ltrim($this->getCore()->config('log.file', 'cms'), '/');
if ($this->getCore()->config('log.daily')) {
$writer->useDailyFiles(storage_path($path), (int) $this->getCore()->config('log.max_files'));
}
foreach ($writer->getMonolog()->getHandlers() as $handler) {
$handler->setLevel($this->getCore()->config('log.threshold'));
}
}
示例3: bootstrap
/**
* Bootstrap the given application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
$logger = new Writer(new Monolog($app->environment()), $app['events']);
// Daily files are better for production stuff
$logger->useDailyFiles(storage_path('/logs/laravel.log'));
$app->instance('log', $logger);
// Next we will bind the a Closure to resolve the PSR logger implementation
// as this will grant us the ability to be interoperable with many other
// libraries which are able to utilize the PSR standardized interface.
$app->bind('Psr\\Log\\LoggerInterface', function ($app) {
return $app['log']->getMonolog();
});
$app->bind('Illuminate\\Contracts\\Logging\\Log', function ($app) {
return $app['log'];
});
}
示例4: useDailyFiles
/**
* Register a daily file log handler.
*
* @param string $path
* @param int $days
* @param string $level
* @return void
* @static
*/
public static function useDailyFiles($path, $days = 0, $level = 'debug')
{
\Illuminate\Log\Writer::useDailyFiles($path, $days, $level);
}
示例5: configureDailyHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureDailyHandler(Application $app, Writer $log)
{
$log->useDailyFiles($app->storagePath() . '/logs/laravel.log', $app->make('config')->get('app.log_max_files', 5));
}
示例6: configureDailyHandler
/**
* @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
*
* @return void
*/
protected function configureDailyHandler(Application $app, Writer $log)
{
$config = $app->make('config');
$maxFiles = $config->get('app.log_max_files');
$log->useDailyFiles($app->storagePath() . '/logs/laravel.log', is_null($maxFiles) ? 5 : $maxFiles, $config->get('app.log_level', 'debug'));
}
示例7: configureDailyHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureDailyHandler(Application $app, Writer $log)
{
$log->useDailyFiles($app->storagePath() . '/logs/laravel.log', 5);
}
示例8: configureDailyHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
*
* @return void
*/
protected function configureDailyHandler(Application $app, Writer $log)
{
$log->useDailyFiles(storage_path('logs/laravel.log'), config('app.log_max_files', 5));
}
示例9: configureDailyHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureDailyHandler(Application $app, Writer $log)
{
$fileName = php_sapi_name();
$log->useDailyFiles($app->storagePath() . '/logs/' . $fileName . '.log', $app->make('config')->get('app.log_max_files', 5));
}
示例10: configureDailyHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureDailyHandler(Writer $log)
{
$log->useDailyFiles($this->app->storagePath() . '/logs/laravel.log', $this->maxFiles(), $this->logLevel());
}